ppc64: Use the merged lmb routines
[powerpc.git] / arch / ppc64 / kernel / cputable.c
1 /*
2  *  arch/ppc64/kernel/cputable.c
3  *
4  *  Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
5  *
6  *  Modifications for ppc64:
7  *      Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
8  *
9  *  This program is free software; you can redistribute it and/or
10  *  modify it under the terms of the GNU General Public License
11  *  as published by the Free Software Foundation; either version
12  *  2 of the License, or (at your option) any later version.
13  */
14
15 #include <linux/config.h>
16 #include <linux/string.h>
17 #include <linux/sched.h>
18 #include <linux/threads.h>
19 #include <linux/init.h>
20 #include <linux/module.h>
21
22 #include <asm/oprofile_impl.h>
23 #include <asm/cputable.h>
24
25 struct cpu_spec* cur_cpu_spec = NULL;
26 EXPORT_SYMBOL(cur_cpu_spec);
27
28 /* NOTE:
29  * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
30  * the responsibility of the appropriate CPU save/restore functions to
31  * eventually copy these settings over. Those save/restore aren't yet
32  * part of the cputable though. That has to be fixed for both ppc32
33  * and ppc64
34  */
35 extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
36 extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
37 extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
38 extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
39
40 struct cpu_spec cpu_specs[] = {
41         {       /* Power3 */
42                 .pvr_mask               = 0xffff0000,
43                 .pvr_value              = 0x00400000,
44                 .cpu_name               = "POWER3 (630)",
45                 .cpu_features           = CPU_FTRS_POWER3,
46                 .cpu_user_features      = COMMON_USER_PPC64,
47                 .icache_bsize           = 128,
48                 .dcache_bsize           = 128,
49                 .num_pmcs               = 8,
50                 .cpu_setup              = __setup_cpu_power3,
51 #ifdef CONFIG_OPROFILE
52                 .oprofile_cpu_type      = "ppc64/power3",
53                 .oprofile_model         = &op_model_rs64,
54 #endif
55         },
56         {       /* Power3+ */
57                 .pvr_mask               = 0xffff0000,
58                 .pvr_value              = 0x00410000,
59                 .cpu_name               = "POWER3 (630+)",
60                 .cpu_features           = CPU_FTRS_POWER3,
61                 .cpu_user_features      = COMMON_USER_PPC64,
62                 .icache_bsize           = 128,
63                 .dcache_bsize           = 128,
64                 .num_pmcs               = 8,
65                 .cpu_setup              = __setup_cpu_power3,
66 #ifdef CONFIG_OPROFILE
67                 .oprofile_cpu_type      = "ppc64/power3",
68                 .oprofile_model         = &op_model_rs64,
69 #endif
70         },
71         {       /* Northstar */
72                 .pvr_mask               = 0xffff0000,
73                 .pvr_value              = 0x00330000,
74                 .cpu_name               = "RS64-II (northstar)",
75                 .cpu_features           = CPU_FTRS_RS64,
76                 .cpu_user_features      = COMMON_USER_PPC64,
77                 .icache_bsize           = 128,
78                 .dcache_bsize           = 128,
79                 .num_pmcs               = 8,
80                 .cpu_setup              = __setup_cpu_power3,
81 #ifdef CONFIG_OPROFILE
82                 .oprofile_cpu_type      = "ppc64/rs64",
83                 .oprofile_model         = &op_model_rs64,
84 #endif
85         },
86         {       /* Pulsar */
87                 .pvr_mask               = 0xffff0000,
88                 .pvr_value              = 0x00340000,
89                 .cpu_name               = "RS64-III (pulsar)",
90                 .cpu_features           = CPU_FTRS_RS64,
91                 .cpu_user_features      = COMMON_USER_PPC64,
92                 .icache_bsize           = 128,
93                 .dcache_bsize           = 128,
94                 .num_pmcs               = 8,
95                 .cpu_setup              = __setup_cpu_power3,
96 #ifdef CONFIG_OPROFILE
97                 .oprofile_cpu_type      = "ppc64/rs64",
98                 .oprofile_model         = &op_model_rs64,
99 #endif
100         },
101         {       /* I-star */
102                 .pvr_mask               = 0xffff0000,
103                 .pvr_value              = 0x00360000,
104                 .cpu_name               = "RS64-III (icestar)",
105                 .cpu_features           = CPU_FTRS_RS64,
106                 .cpu_user_features      = COMMON_USER_PPC64,
107                 .icache_bsize           = 128,
108                 .dcache_bsize           = 128,
109                 .num_pmcs               = 8,
110                 .cpu_setup              = __setup_cpu_power3,
111 #ifdef CONFIG_OPROFILE
112                 .oprofile_cpu_type      = "ppc64/rs64",
113                 .oprofile_model         = &op_model_rs64,
114 #endif
115         },
116         {       /* S-star */
117                 .pvr_mask               = 0xffff0000,
118                 .pvr_value              = 0x00370000,
119                 .cpu_name               = "RS64-IV (sstar)",
120                 .cpu_features           = CPU_FTRS_RS64,
121                 .cpu_user_features      = COMMON_USER_PPC64,
122                 .icache_bsize           = 128,
123                 .dcache_bsize           = 128,
124                 .num_pmcs               = 8,
125                 .cpu_setup              = __setup_cpu_power3,
126 #ifdef CONFIG_OPROFILE
127                 .oprofile_cpu_type      = "ppc64/rs64",
128                 .oprofile_model         = &op_model_rs64,
129 #endif
130         },
131         {       /* Power4 */
132                 .pvr_mask               = 0xffff0000,
133                 .pvr_value              = 0x00350000,
134                 .cpu_name               = "POWER4 (gp)",
135                 .cpu_features           = CPU_FTRS_POWER4,
136                 .cpu_user_features      = COMMON_USER_PPC64,
137                 .icache_bsize           = 128,
138                 .dcache_bsize           = 128,
139                 .num_pmcs               = 8,
140                 .cpu_setup              = __setup_cpu_power4,
141 #ifdef CONFIG_OPROFILE
142                 .oprofile_cpu_type      = "ppc64/power4",
143                 .oprofile_model         = &op_model_rs64,
144 #endif
145         },
146         {       /* Power4+ */
147                 .pvr_mask               = 0xffff0000,
148                 .pvr_value              = 0x00380000,
149                 .cpu_name               = "POWER4+ (gq)",
150                 .cpu_features           = CPU_FTRS_POWER4,
151                 .cpu_user_features      = COMMON_USER_PPC64,
152                 .icache_bsize           = 128,
153                 .dcache_bsize           = 128,
154                 .num_pmcs               = 8,
155                 .cpu_setup              = __setup_cpu_power4,
156 #ifdef CONFIG_OPROFILE
157                 .oprofile_cpu_type      = "ppc64/power4",
158                 .oprofile_model         = &op_model_power4,
159 #endif
160         },
161         {       /* PPC970 */
162                 .pvr_mask               = 0xffff0000,
163                 .pvr_value              = 0x00390000,
164                 .cpu_name               = "PPC970",
165                 .cpu_features           = CPU_FTRS_PPC970,
166                 .cpu_user_features      = COMMON_USER_PPC64 |
167                         PPC_FEATURE_HAS_ALTIVEC_COMP,
168                 .icache_bsize           = 128,
169                 .dcache_bsize           = 128,
170                 .num_pmcs               = 8,
171                 .cpu_setup              = __setup_cpu_ppc970,
172 #ifdef CONFIG_OPROFILE
173                 .oprofile_cpu_type      = "ppc64/970",
174                 .oprofile_model         = &op_model_power4,
175 #endif
176         },
177         {       /* PPC970FX */
178                 .pvr_mask               = 0xffff0000,
179                 .pvr_value              = 0x003c0000,
180                 .cpu_name               = "PPC970FX",
181                 .cpu_features           = CPU_FTRS_PPC970,
182                 .cpu_user_features      = COMMON_USER_PPC64 |
183                         PPC_FEATURE_HAS_ALTIVEC_COMP,
184                 .icache_bsize           = 128,
185                 .dcache_bsize           = 128,
186                 .num_pmcs               = 8,
187                 .cpu_setup              = __setup_cpu_ppc970,
188 #ifdef CONFIG_OPROFILE
189                 .oprofile_cpu_type      = "ppc64/970",
190                 .oprofile_model         = &op_model_power4,
191 #endif
192         },
193         {       /* PPC970MP */
194                 .pvr_mask               = 0xffff0000,
195                 .pvr_value              = 0x00440000,
196                 .cpu_name               = "PPC970MP",
197                 .cpu_features           = CPU_FTRS_PPC970,
198                 .cpu_user_features      = COMMON_USER_PPC64 |
199                         PPC_FEATURE_HAS_ALTIVEC_COMP,
200                 .icache_bsize           = 128,
201                 .dcache_bsize           = 128,
202                 .cpu_setup              = __setup_cpu_ppc970,
203 #ifdef CONFIG_OPROFILE
204                 .oprofile_cpu_type      = "ppc64/970",
205                 .oprofile_model         = &op_model_power4,
206 #endif
207         },
208         {       /* Power5 */
209                 .pvr_mask               = 0xffff0000,
210                 .pvr_value              = 0x003a0000,
211                 .cpu_name               = "POWER5 (gr)",
212                 .cpu_features           = CPU_FTRS_POWER5,
213                 .cpu_user_features      = COMMON_USER_PPC64,
214                 .icache_bsize           = 128,
215                 .dcache_bsize           = 128,
216                 .num_pmcs               = 6,
217                 .cpu_setup              = __setup_cpu_power4,
218 #ifdef CONFIG_OPROFILE
219                 .oprofile_cpu_type      = "ppc64/power5",
220                 .oprofile_model         = &op_model_power4,
221 #endif
222         },
223         {       /* Power5 */
224                 .pvr_mask               = 0xffff0000,
225                 .pvr_value              = 0x003b0000,
226                 .cpu_name               = "POWER5 (gs)",
227                 .cpu_features           = CPU_FTRS_POWER5,
228                 .cpu_user_features      = COMMON_USER_PPC64,
229                 .icache_bsize           = 128,
230                 .dcache_bsize           = 128,
231                 .num_pmcs               = 6,
232                 .cpu_setup              = __setup_cpu_power4,
233 #ifdef CONFIG_OPROFILE
234                 .oprofile_cpu_type      = "ppc64/power5",
235                 .oprofile_model         = &op_model_power4,
236 #endif
237         },
238         {       /* BE DD1.x */
239                 .pvr_mask               = 0xffff0000,
240                 .pvr_value              = 0x00700000,
241                 .cpu_name               = "Cell Broadband Engine",
242                 .cpu_features           = CPU_FTRS_CELL,
243                 .cpu_user_features      = COMMON_USER_PPC64 |
244                         PPC_FEATURE_HAS_ALTIVEC_COMP,
245                 .icache_bsize           = 128,
246                 .dcache_bsize           = 128,
247                 .cpu_setup              = __setup_cpu_be,
248         },
249         {       /* default match */
250                 .pvr_mask               = 0x00000000,
251                 .pvr_value              = 0x00000000,
252                 .cpu_name               = "POWER4 (compatible)",
253                 .cpu_features           = CPU_FTRS_COMPATIBLE,
254                 .cpu_user_features      = COMMON_USER_PPC64,
255                 .icache_bsize           = 128,
256                 .dcache_bsize           = 128,
257                 .num_pmcs               = 6,
258                 .cpu_setup              = __setup_cpu_power4,
259         }
260 };