diff options
author | David Daney <ddaney@caviumnetworks.com> | 2010-10-07 19:03:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-10-29 14:08:34 -0400 |
commit | a70b13a9f07ae0e21870ed3e9b6829f556579c5c (patch) | |
tree | e15268066b0b35a0791c76568156812b8973dab4 /arch | |
parent | aa32a955ae46d4117e880417c89a2efcc88579c2 (diff) |
MIPS: Octeon: Add cn63XX to Octeon chip detection macros.
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Patchwork: http://patchwork.linux-mips.org/patch/1661/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/include/asm/octeon/octeon-model.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/arch/mips/include/asm/octeon/octeon-model.h b/arch/mips/include/asm/octeon/octeon-model.h index cf50336eca2e..700f88e31cad 100644 --- a/arch/mips/include/asm/octeon/octeon-model.h +++ b/arch/mips/include/asm/octeon/octeon-model.h | |||
@@ -35,14 +35,6 @@ | |||
35 | #ifndef __OCTEON_MODEL_H__ | 35 | #ifndef __OCTEON_MODEL_H__ |
36 | #define __OCTEON_MODEL_H__ | 36 | #define __OCTEON_MODEL_H__ |
37 | 37 | ||
38 | /* NOTE: These must match what is checked in common-config.mk */ | ||
39 | /* Defines to represent the different versions of Octeon. */ | ||
40 | |||
41 | /* | ||
42 | * IMPORTANT: When the default pass is updated for an Octeon Model, | ||
43 | * the corresponding change must also be made in the oct-sim script. | ||
44 | */ | ||
45 | |||
46 | /* | 38 | /* |
47 | * The defines below should be used with the OCTEON_IS_MODEL() macro | 39 | * The defines below should be used with the OCTEON_IS_MODEL() macro |
48 | * to determine what model of chip the software is running on. Models | 40 | * to determine what model of chip the software is running on. Models |
@@ -71,6 +63,21 @@ | |||
71 | #define OM_IGNORE_MINOR_REVISION 0x08000000 | 63 | #define OM_IGNORE_MINOR_REVISION 0x08000000 |
72 | #define OM_FLAG_MASK 0xff000000 | 64 | #define OM_FLAG_MASK 0xff000000 |
73 | 65 | ||
66 | #define OM_MATCH_5XXX_FAMILY_MODELS 0x20000000 /* Match all cn5XXX Octeon models. */ | ||
67 | #define OM_MATCH_6XXX_FAMILY_MODELS 0x40000000 /* Match all cn6XXX Octeon models. */ | ||
68 | |||
69 | /* | ||
70 | * CN6XXX models with new revision encoding | ||
71 | */ | ||
72 | #define OCTEON_CN63XX_PASS1_0 0x000d9000 | ||
73 | #define OCTEON_CN63XX_PASS1_1 0x000d9001 | ||
74 | #define OCTEON_CN63XX_PASS1_2 0x000d9002 | ||
75 | #define OCTEON_CN63XX_PASS2_0 0x000d9008 | ||
76 | |||
77 | #define OCTEON_CN63XX (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_REVISION) | ||
78 | #define OCTEON_CN63XX_PASS1_X (OCTEON_CN63XX_PASS1_0 | OM_IGNORE_MINOR_REVISION) | ||
79 | #define OCTEON_CN63XX_PASS2_X (OCTEON_CN63XX_PASS2_0 | OM_IGNORE_MINOR_REVISION) | ||
80 | |||
74 | /* | 81 | /* |
75 | * CN5XXX models with new revision encoding | 82 | * CN5XXX models with new revision encoding |
76 | */ | 83 | */ |
@@ -189,6 +196,9 @@ | |||
189 | | OM_MATCH_PREVIOUS_MODELS \ | 196 | | OM_MATCH_PREVIOUS_MODELS \ |
190 | | OM_IGNORE_REVISION) | 197 | | OM_IGNORE_REVISION) |
191 | 198 | ||
199 | #define OCTEON_CN5XXX (OCTEON_CN58XX_PASS1_0 | OM_MATCH_5XXX_FAMILY_MODELS) | ||
200 | #define OCTEON_CN6XXX (OCTEON_CN63XX_PASS1_0 | OM_MATCH_6XXX_FAMILY_MODELS) | ||
201 | |||
192 | /* The revision byte (low byte) has two different encodings. | 202 | /* The revision byte (low byte) has two different encodings. |
193 | * CN3XXX: | 203 | * CN3XXX: |
194 | * | 204 | * |
@@ -222,6 +232,7 @@ | |||
222 | | OCTEON_58XX_MODEL_MASK) | 232 | | OCTEON_58XX_MODEL_MASK) |
223 | #define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK \ | 233 | #define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK \ |
224 | & 0x00fffff8) | 234 | & 0x00fffff8) |
235 | #define OCTEON_5XXX_MODEL_MASK 0x00ff0fc0 | ||
225 | 236 | ||
226 | #define __OCTEON_MATCH_MASK__(x, y, z) (((x) & (z)) == ((y) & (z))) | 237 | #define __OCTEON_MATCH_MASK__(x, y, z) (((x) & (z)) == ((y) & (z))) |
227 | 238 | ||
@@ -273,6 +284,15 @@ static inline int __OCTEON_IS_MODEL_COMPILE__(uint32_t arg_model, | |||
273 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), | 284 | __OCTEON_MATCH_MASK__((chip_model), (arg_model), |
274 | OCTEON_58XX_MODEL_REV_MASK)) | 285 | OCTEON_58XX_MODEL_REV_MASK)) |
275 | return 1; | 286 | return 1; |
287 | |||
288 | if (((arg_model & OM_MATCH_5XXX_FAMILY_MODELS) == OM_MATCH_5XXX_FAMILY_MODELS) && | ||
289 | ((chip_model) >= OCTEON_CN58XX_PASS1_0) && ((chip_model) < OCTEON_CN63XX_PASS1_0)) | ||
290 | return 1; | ||
291 | |||
292 | if (((arg_model & OM_MATCH_6XXX_FAMILY_MODELS) == OM_MATCH_6XXX_FAMILY_MODELS) && | ||
293 | ((chip_model) >= OCTEON_CN63XX_PASS1_0)) | ||
294 | return 1; | ||
295 | |||
276 | if ((arg_model & OM_MATCH_PREVIOUS_MODELS) && | 296 | if ((arg_model & OM_MATCH_PREVIOUS_MODELS) && |
277 | ((chip_model & OCTEON_58XX_MODEL_MASK) < | 297 | ((chip_model & OCTEON_58XX_MODEL_MASK) < |
278 | (arg_model & OCTEON_58XX_MODEL_MASK))) | 298 | (arg_model & OCTEON_58XX_MODEL_MASK))) |