diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-05-05 12:45:59 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:31:12 -0400 |
commit | 4194318c3941fa9cfaa63dfdab9054fcae5e08d3 (patch) | |
tree | 2b44341a9cb911e34efbb33a35142fd2dcd536ff | |
parent | cd21dfcfbb5c43de54f6be795dde07397da2bc2f (diff) |
Cleanup decoding of MIPSxx config registers.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 141 | ||||
-rw-r--r-- | arch/mips/kernel/proc.c | 8 | ||||
-rw-r--r-- | include/asm-mips/cpu-features.h | 16 | ||||
-rw-r--r-- | include/asm-mips/cpu-info.h | 2 | ||||
-rw-r--r-- | include/asm-mips/cpu.h | 10 | ||||
-rw-r--r-- | include/asm-mips/mipsregs.h | 47 |
6 files changed, 175 insertions, 49 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 21ef82de8c5b..ba2dbc266d51 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -2,9 +2,9 @@ | |||
2 | * Processor capabilities determination functions. | 2 | * Processor capabilities determination functions. |
3 | * | 3 | * |
4 | * Copyright (C) xxxx the Anonymous | 4 | * Copyright (C) xxxx the Anonymous |
5 | * Copyright (C) 2003 Maciej W. Rozycki | 5 | * Copyright (C) 2003, 2004 Maciej W. Rozycki |
6 | * Copyright (C) 1994 - 2003 Ralf Baechle | 6 | * Copyright (C) 1994 - 2003 Ralf Baechle |
7 | * Copyright (C) 2001 MIPS Inc. | 7 | * Copyright (C) 2001, 2004 MIPS Inc. |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public License | 10 | * modify it under the terms of the GNU General Public License |
@@ -415,69 +415,126 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) | |||
415 | } | 415 | } |
416 | } | 416 | } |
417 | 417 | ||
418 | static inline void decode_config1(struct cpuinfo_mips *c) | 418 | static inline unsigned int decode_config0(struct cpuinfo_mips *c) |
419 | { | 419 | { |
420 | unsigned long config0 = read_c0_config(); | 420 | unsigned int config0; |
421 | unsigned long config1; | 421 | int isa; |
422 | 422 | ||
423 | if ((config0 & (1 << 31)) == 0) | 423 | config0 = read_c0_config(); |
424 | return; /* actually wort a panic() */ | 424 | |
425 | if (((config0 & MIPS_CONF_MT) >> 7) == 1) | ||
426 | c->options |= MIPS_CPU_TLB; | ||
427 | isa = (config0 & MIPS_CONF_AT) >> 13; | ||
428 | switch (isa) { | ||
429 | case 0: | ||
430 | c->isa_level = MIPS_CPU_ISA_M32; | ||
431 | break; | ||
432 | case 2: | ||
433 | c->isa_level = MIPS_CPU_ISA_M64; | ||
434 | break; | ||
435 | default: | ||
436 | panic("Unsupported ISA type, cp0.config0.at: %d.", isa); | ||
437 | } | ||
438 | |||
439 | return config0 & MIPS_CONF_M; | ||
440 | } | ||
441 | |||
442 | static inline unsigned int decode_config1(struct cpuinfo_mips *c) | ||
443 | { | ||
444 | unsigned int config1; | ||
425 | 445 | ||
426 | /* MIPS32 or MIPS64 compliant CPU. Read Config 1 register. */ | ||
427 | c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | | ||
428 | MIPS_CPU_4KTLB | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | | ||
429 | MIPS_CPU_LLSC | MIPS_CPU_MCHECK; | ||
430 | config1 = read_c0_config1(); | 446 | config1 = read_c0_config1(); |
431 | if (config1 & (1 << 3)) | 447 | |
448 | if (config1 & MIPS_CONF1_MD) | ||
449 | c->ases |= MIPS_ASE_MDMX; | ||
450 | if (config1 & MIPS_CONF1_WR) | ||
432 | c->options |= MIPS_CPU_WATCH; | 451 | c->options |= MIPS_CPU_WATCH; |
433 | if (config1 & (1 << 2)) | 452 | if (config1 & MIPS_CONF1_CA) |
434 | c->options |= MIPS_CPU_MIPS16; | 453 | c->ases |= MIPS_ASE_MIPS16; |
435 | if (config1 & (1 << 1)) | 454 | if (config1 & MIPS_CONF1_EP) |
436 | c->options |= MIPS_CPU_EJTAG; | 455 | c->options |= MIPS_CPU_EJTAG; |
437 | if (config1 & 1) { | 456 | if (config1 & MIPS_CONF1_FP) { |
438 | c->options |= MIPS_CPU_FPU; | 457 | c->options |= MIPS_CPU_FPU; |
439 | c->options |= MIPS_CPU_32FPR; | 458 | c->options |= MIPS_CPU_32FPR; |
440 | } | 459 | } |
460 | if (cpu_has_tlb) | ||
461 | c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1; | ||
462 | |||
463 | return config1 & MIPS_CONF_M; | ||
464 | } | ||
465 | |||
466 | static inline unsigned int decode_config2(struct cpuinfo_mips *c) | ||
467 | { | ||
468 | unsigned int config2; | ||
469 | |||
470 | config2 = read_c0_config2(); | ||
471 | |||
472 | if (config2 & MIPS_CONF2_SL) | ||
473 | c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; | ||
474 | |||
475 | return config2 & MIPS_CONF_M; | ||
476 | } | ||
477 | |||
478 | static inline unsigned int decode_config3(struct cpuinfo_mips *c) | ||
479 | { | ||
480 | unsigned int config3; | ||
481 | |||
482 | config3 = read_c0_config3(); | ||
483 | |||
484 | if (config3 & MIPS_CONF3_SM) | ||
485 | c->ases |= MIPS_ASE_SMARTMIPS; | ||
486 | |||
487 | return config3 & MIPS_CONF_M; | ||
488 | } | ||
489 | |||
490 | static inline void decode_configs(struct cpuinfo_mips *c) | ||
491 | { | ||
492 | /* MIPS32 or MIPS64 compliant CPU. */ | ||
493 | c->options = MIPS_CPU_4KEX | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | | ||
494 | MIPS_CPU_LLSC | MIPS_CPU_MCHECK; | ||
495 | |||
441 | c->scache.flags = MIPS_CACHE_NOT_PRESENT; | 496 | c->scache.flags = MIPS_CACHE_NOT_PRESENT; |
442 | 497 | ||
443 | c->tlbsize = ((config1 >> 25) & 0x3f) + 1; | 498 | /* Read Config registers. */ |
499 | if (!decode_config0(c)) | ||
500 | return; /* actually worth a panic() */ | ||
501 | if (!decode_config1(c)) | ||
502 | return; | ||
503 | if (!decode_config2(c)) | ||
504 | return; | ||
505 | if (!decode_config3(c)) | ||
506 | return; | ||
444 | } | 507 | } |
445 | 508 | ||
446 | static inline void cpu_probe_mips(struct cpuinfo_mips *c) | 509 | static inline void cpu_probe_mips(struct cpuinfo_mips *c) |
447 | { | 510 | { |
448 | decode_config1(c); | 511 | decode_configs(c); |
512 | if (cpu_has_tlb) | ||
513 | c->options |= MIPS_CPU_4KTLB; | ||
449 | switch (c->processor_id & 0xff00) { | 514 | switch (c->processor_id & 0xff00) { |
450 | case PRID_IMP_4KC: | 515 | case PRID_IMP_4KC: |
451 | c->cputype = CPU_4KC; | 516 | c->cputype = CPU_4KC; |
452 | c->isa_level = MIPS_CPU_ISA_M32; | ||
453 | break; | 517 | break; |
454 | case PRID_IMP_4KEC: | 518 | case PRID_IMP_4KEC: |
455 | c->cputype = CPU_4KEC; | 519 | c->cputype = CPU_4KEC; |
456 | c->isa_level = MIPS_CPU_ISA_M32; | ||
457 | break; | 520 | break; |
458 | case PRID_IMP_4KECR2: | 521 | case PRID_IMP_4KECR2: |
459 | c->cputype = CPU_4KEC; | 522 | c->cputype = CPU_4KEC; |
460 | c->isa_level = MIPS_CPU_ISA_M32; | ||
461 | break; | 523 | break; |
462 | case PRID_IMP_4KSC: | 524 | case PRID_IMP_4KSC: |
463 | c->cputype = CPU_4KSC; | 525 | c->cputype = CPU_4KSC; |
464 | c->isa_level = MIPS_CPU_ISA_M32; | ||
465 | break; | 526 | break; |
466 | case PRID_IMP_5KC: | 527 | case PRID_IMP_5KC: |
467 | c->cputype = CPU_5KC; | 528 | c->cputype = CPU_5KC; |
468 | c->isa_level = MIPS_CPU_ISA_M64; | ||
469 | break; | 529 | break; |
470 | case PRID_IMP_20KC: | 530 | case PRID_IMP_20KC: |
471 | c->cputype = CPU_20KC; | 531 | c->cputype = CPU_20KC; |
472 | c->isa_level = MIPS_CPU_ISA_M64; | ||
473 | break; | 532 | break; |
474 | case PRID_IMP_24K: | 533 | case PRID_IMP_24K: |
475 | c->cputype = CPU_24K; | 534 | c->cputype = CPU_24K; |
476 | c->isa_level = MIPS_CPU_ISA_M32; | ||
477 | break; | 535 | break; |
478 | case PRID_IMP_25KF: | 536 | case PRID_IMP_25KF: |
479 | c->cputype = CPU_25KF; | 537 | c->cputype = CPU_25KF; |
480 | c->isa_level = MIPS_CPU_ISA_M64; | ||
481 | /* Probe for L2 cache */ | 538 | /* Probe for L2 cache */ |
482 | c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; | 539 | c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT; |
483 | break; | 540 | break; |
@@ -486,7 +543,7 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c) | |||
486 | 543 | ||
487 | static inline void cpu_probe_alchemy(struct cpuinfo_mips *c) | 544 | static inline void cpu_probe_alchemy(struct cpuinfo_mips *c) |
488 | { | 545 | { |
489 | decode_config1(c); | 546 | decode_configs(c); |
490 | switch (c->processor_id & 0xff00) { | 547 | switch (c->processor_id & 0xff00) { |
491 | case PRID_IMP_AU1_REV1: | 548 | case PRID_IMP_AU1_REV1: |
492 | case PRID_IMP_AU1_REV2: | 549 | case PRID_IMP_AU1_REV2: |
@@ -510,25 +567,19 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c) | |||
510 | panic("Unknown Au Core!"); | 567 | panic("Unknown Au Core!"); |
511 | break; | 568 | break; |
512 | } | 569 | } |
513 | c->isa_level = MIPS_CPU_ISA_M32; | ||
514 | break; | 570 | break; |
515 | } | 571 | } |
516 | } | 572 | } |
517 | 573 | ||
518 | static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) | 574 | static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) |
519 | { | 575 | { |
520 | decode_config1(c); | 576 | decode_configs(c); |
521 | switch (c->processor_id & 0xff00) { | 577 | switch (c->processor_id & 0xff00) { |
522 | case PRID_IMP_SB1: | 578 | case PRID_IMP_SB1: |
523 | c->cputype = CPU_SB1; | 579 | c->cputype = CPU_SB1; |
524 | c->isa_level = MIPS_CPU_ISA_M64; | 580 | #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS |
525 | c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | | ||
526 | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | | ||
527 | MIPS_CPU_MCHECK | MIPS_CPU_EJTAG | | ||
528 | MIPS_CPU_WATCH | MIPS_CPU_LLSC; | ||
529 | #ifndef CONFIG_SB1_PASS_1_WORKAROUNDS | ||
530 | /* FPU in pass1 is known to have issues. */ | 581 | /* FPU in pass1 is known to have issues. */ |
531 | c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR; | 582 | c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); |
532 | #endif | 583 | #endif |
533 | break; | 584 | break; |
534 | } | 585 | } |
@@ -536,14 +587,12 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) | |||
536 | 587 | ||
537 | static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c) | 588 | static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c) |
538 | { | 589 | { |
539 | decode_config1(c); | 590 | decode_configs(c); |
591 | if (cpu_has_tlb) | ||
592 | c->options |= MIPS_CPU_4KTLB; | ||
540 | switch (c->processor_id & 0xff00) { | 593 | switch (c->processor_id & 0xff00) { |
541 | case PRID_IMP_SR71000: | 594 | case PRID_IMP_SR71000: |
542 | c->cputype = CPU_SR71000; | 595 | c->cputype = CPU_SR71000; |
543 | c->isa_level = MIPS_CPU_ISA_M64; | ||
544 | c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | | ||
545 | MIPS_CPU_4KTLB | MIPS_CPU_FPU | | ||
546 | MIPS_CPU_COUNTER | MIPS_CPU_MCHECK; | ||
547 | c->scache.ways = 8; | 596 | c->scache.ways = 8; |
548 | c->tlbsize = 64; | 597 | c->tlbsize = 64; |
549 | break; | 598 | break; |
@@ -572,15 +621,21 @@ __init void cpu_probe(void) | |||
572 | case PRID_COMP_SIBYTE: | 621 | case PRID_COMP_SIBYTE: |
573 | cpu_probe_sibyte(c); | 622 | cpu_probe_sibyte(c); |
574 | break; | 623 | break; |
575 | |||
576 | case PRID_COMP_SANDCRAFT: | 624 | case PRID_COMP_SANDCRAFT: |
577 | cpu_probe_sandcraft(c); | 625 | cpu_probe_sandcraft(c); |
578 | break; | 626 | break; |
579 | default: | 627 | default: |
580 | c->cputype = CPU_UNKNOWN; | 628 | c->cputype = CPU_UNKNOWN; |
581 | } | 629 | } |
582 | if (c->options & MIPS_CPU_FPU) | 630 | if (c->options & MIPS_CPU_FPU) { |
583 | c->fpu_id = cpu_get_fpu_id(); | 631 | c->fpu_id = cpu_get_fpu_id(); |
632 | |||
633 | if (c->isa_level == MIPS_CPU_ISA_M32 || | ||
634 | c->isa_level == MIPS_CPU_ISA_M64) { | ||
635 | if (c->fpu_id & MIPS_FPIR_3D) | ||
636 | c->ases |= MIPS_ASE_MIPS3D; | ||
637 | } | ||
638 | } | ||
584 | } | 639 | } |
585 | 640 | ||
586 | __init void cpu_report(void) | 641 | __init void cpu_report(void) |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index d1290b1ec408..cf31d3952d65 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -2,7 +2,8 @@ | |||
2 | * linux/arch/mips/kernel/proc.c | 2 | * linux/arch/mips/kernel/proc.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995, 1996, 2001 Ralf Baechle | 4 | * Copyright (C) 1995, 1996, 2001 Ralf Baechle |
5 | * Copyright (C) 2001 MIPS Technologies, Inc. | 5 | * Copyright (C) 2001, 2004 MIPS Technologies, Inc. |
6 | * Copyright (C) 2004 Maciej W. Rozycki | ||
6 | */ | 7 | */ |
7 | #include <linux/config.h> | 8 | #include <linux/config.h> |
8 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
@@ -118,6 +119,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
118 | cpu_has_divec ? "yes" : "no"); | 119 | cpu_has_divec ? "yes" : "no"); |
119 | seq_printf(m, "hardware watchpoint\t: %s\n", | 120 | seq_printf(m, "hardware watchpoint\t: %s\n", |
120 | cpu_has_watch ? "yes" : "no"); | 121 | cpu_has_watch ? "yes" : "no"); |
122 | seq_printf(m, "ASEs implemented\t:%s%s%s%s\n", | ||
123 | cpu_has_mips16 ? " mips16" : "", | ||
124 | cpu_has_mdmx ? " mdmx" : "", | ||
125 | cpu_has_mips3d ? " mips3d" : "", | ||
126 | cpu_has_smartmips ? " smartmips" : ""); | ||
121 | 127 | ||
122 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", | 128 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", |
123 | cpu_has_vce ? "%u" : "not available"); | 129 | cpu_has_vce ? "%u" : "not available"); |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index 9a2de642eee6..012deda63e68 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 2003, 2004 Ralf Baechle | 6 | * Copyright (C) 2003, 2004 Ralf Baechle |
7 | * Copyright (C) 2004 Maciej W. Rozycki | ||
7 | */ | 8 | */ |
8 | #ifndef __ASM_CPU_FEATURES_H | 9 | #ifndef __ASM_CPU_FEATURES_H |
9 | #define __ASM_CPU_FEATURES_H | 10 | #define __ASM_CPU_FEATURES_H |
@@ -39,9 +40,6 @@ | |||
39 | #ifndef cpu_has_watch | 40 | #ifndef cpu_has_watch |
40 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) | 41 | #define cpu_has_watch (cpu_data[0].options & MIPS_CPU_WATCH) |
41 | #endif | 42 | #endif |
42 | #ifndef cpu_has_mips16 | ||
43 | #define cpu_has_mips16 (cpu_data[0].options & MIPS_CPU_MIPS16) | ||
44 | #endif | ||
45 | #ifndef cpu_has_divec | 43 | #ifndef cpu_has_divec |
46 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) | 44 | #define cpu_has_divec (cpu_data[0].options & MIPS_CPU_DIVEC) |
47 | #endif | 45 | #endif |
@@ -66,6 +64,18 @@ | |||
66 | #ifndef cpu_has_llsc | 64 | #ifndef cpu_has_llsc |
67 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) | 65 | #define cpu_has_llsc (cpu_data[0].options & MIPS_CPU_LLSC) |
68 | #endif | 66 | #endif |
67 | #ifndef cpu_has_mips16 | ||
68 | #define cpu_has_mips16 (cpu_data[0].ases & MIPS_ASE_MIPS16) | ||
69 | #endif | ||
70 | #ifndef cpu_has_mdmx | ||
71 | #define cpu_has_mdmx (cpu_data[0].ases & MIPS_ASE_MDMX) | ||
72 | #endif | ||
73 | #ifndef cpu_has_mips3d | ||
74 | #define cpu_has_mips3d (cpu_data[0].ases & MIPS_ASE_MIPS3D) | ||
75 | #endif | ||
76 | #ifndef cpu_has_smartmips | ||
77 | #define cpu_has_smartmips (cpu_data[0].ases & MIPS_ASE_SMARTMIPS) | ||
78 | #endif | ||
69 | #ifndef cpu_has_vtag_icache | 79 | #ifndef cpu_has_vtag_icache |
70 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) | 80 | #define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) |
71 | #endif | 81 | #endif |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index 20a35b15a31d..d5cf519f8fcc 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -7,6 +7,7 @@ | |||
7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle | 7 | * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003 Ralf Baechle |
8 | * Copyright (C) 1996 Paul M. Antoine | 8 | * Copyright (C) 1996 Paul M. Antoine |
9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 9 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
10 | * Copyright (C) 2004 Maciej W. Rozycki | ||
10 | */ | 11 | */ |
11 | #ifndef __ASM_CPU_INFO_H | 12 | #ifndef __ASM_CPU_INFO_H |
12 | #define __ASM_CPU_INFO_H | 13 | #define __ASM_CPU_INFO_H |
@@ -61,6 +62,7 @@ struct cpuinfo_mips { | |||
61 | * Capability and feature descriptor structure for MIPS CPU | 62 | * Capability and feature descriptor structure for MIPS CPU |
62 | */ | 63 | */ |
63 | unsigned long options; | 64 | unsigned long options; |
65 | unsigned long ases; | ||
64 | unsigned int processor_id; | 66 | unsigned int processor_id; |
65 | unsigned int fpu_id; | 67 | unsigned int fpu_id; |
66 | unsigned int cputype; | 68 | unsigned int cputype; |
diff --git a/include/asm-mips/cpu.h b/include/asm-mips/cpu.h index 8e167bfd40b1..a4f85a279c52 100644 --- a/include/asm-mips/cpu.h +++ b/include/asm-mips/cpu.h | |||
@@ -3,6 +3,7 @@ | |||
3 | * various MIPS cpu types. | 3 | * various MIPS cpu types. |
4 | * | 4 | * |
5 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | 5 | * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) |
6 | * Copyright (C) 2004 Maciej W. Rozycki | ||
6 | */ | 7 | */ |
7 | #ifndef _ASM_CPU_H | 8 | #ifndef _ASM_CPU_H |
8 | #define _ASM_CPU_H | 9 | #define _ASM_CPU_H |
@@ -213,7 +214,6 @@ | |||
213 | #define MIPS_CPU_32FPR 0x00000020 /* 32 dbl. prec. FP registers */ | 214 | #define MIPS_CPU_32FPR 0x00000020 /* 32 dbl. prec. FP registers */ |
214 | #define MIPS_CPU_COUNTER 0x00000040 /* Cycle count/compare */ | 215 | #define MIPS_CPU_COUNTER 0x00000040 /* Cycle count/compare */ |
215 | #define MIPS_CPU_WATCH 0x00000080 /* watchpoint registers */ | 216 | #define MIPS_CPU_WATCH 0x00000080 /* watchpoint registers */ |
216 | #define MIPS_CPU_MIPS16 0x00000100 /* code compression */ | ||
217 | #define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */ | 217 | #define MIPS_CPU_DIVEC 0x00000200 /* dedicated interrupt vector */ |
218 | #define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */ | 218 | #define MIPS_CPU_VCE 0x00000400 /* virt. coherence conflict possible */ |
219 | #define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */ | 219 | #define MIPS_CPU_CACHE_CDEX_P 0x00000800 /* Create_Dirty_Exclusive CACHE op */ |
@@ -225,4 +225,12 @@ | |||
225 | #define MIPS_CPU_SUBSET_CACHES 0x00020000 /* P-cache subset enforced */ | 225 | #define MIPS_CPU_SUBSET_CACHES 0x00020000 /* P-cache subset enforced */ |
226 | #define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */ | 226 | #define MIPS_CPU_PREFETCH 0x00040000 /* CPU has usable prefetch */ |
227 | 227 | ||
228 | /* | ||
229 | * CPU ASE encodings | ||
230 | */ | ||
231 | #define MIPS_ASE_MIPS16 0x00000001 /* code compression */ | ||
232 | #define MIPS_ASE_MDMX 0x00000002 /* MIPS digital media extension */ | ||
233 | #define MIPS_ASE_MIPS3D 0x00000004 /* MIPS-3D */ | ||
234 | #define MIPS_ASE_SMARTMIPS 0x00000008 /* SmartMIPS */ | ||
235 | |||
228 | #endif /* _ASM_CPU_H */ | 236 | #endif /* _ASM_CPU_H */ |
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h index f3b0b4181508..9b0ce451286e 100644 --- a/include/asm-mips/mipsregs.h +++ b/include/asm-mips/mipsregs.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. | 8 | * Modified for further R[236]000 support by Paul M. Antoine, 1996. |
9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com | 9 | * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com |
10 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. | 10 | * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved. |
11 | * Copyright (C) 2003 Maciej W. Rozycki | 11 | * Copyright (C) 2003, 2004 Maciej W. Rozycki |
12 | */ | 12 | */ |
13 | #ifndef _ASM_MIPSREGS_H | 13 | #ifndef _ASM_MIPSREGS_H |
14 | #define _ASM_MIPSREGS_H | 14 | #define _ASM_MIPSREGS_H |
@@ -478,6 +478,51 @@ | |||
478 | #define MIPS_CONF_M (_ULCAST_(1) << 31) | 478 | #define MIPS_CONF_M (_ULCAST_(1) << 31) |
479 | 479 | ||
480 | /* | 480 | /* |
481 | * Bits in the MIPS32/64 PRA coprocessor 0 config registers 1 and above. | ||
482 | */ | ||
483 | #define MIPS_CONF1_FP (_ULCAST_(1) << 0) | ||
484 | #define MIPS_CONF1_EP (_ULCAST_(1) << 1) | ||
485 | #define MIPS_CONF1_CA (_ULCAST_(1) << 2) | ||
486 | #define MIPS_CONF1_WR (_ULCAST_(1) << 3) | ||
487 | #define MIPS_CONF1_PC (_ULCAST_(1) << 4) | ||
488 | #define MIPS_CONF1_MD (_ULCAST_(1) << 5) | ||
489 | #define MIPS_CONF1_C2 (_ULCAST_(1) << 6) | ||
490 | #define MIPS_CONF1_DA (_ULCAST_(7) << 7) | ||
491 | #define MIPS_CONF1_DL (_ULCAST_(7) << 10) | ||
492 | #define MIPS_CONF1_DS (_ULCAST_(7) << 13) | ||
493 | #define MIPS_CONF1_IA (_ULCAST_(7) << 16) | ||
494 | #define MIPS_CONF1_IL (_ULCAST_(7) << 19) | ||
495 | #define MIPS_CONF1_IS (_ULCAST_(7) << 22) | ||
496 | #define MIPS_CONF1_TLBS (_ULCAST_(63)<< 25) | ||
497 | |||
498 | #define MIPS_CONF2_SA (_ULCAST_(15)<< 0) | ||
499 | #define MIPS_CONF2_SL (_ULCAST_(15)<< 4) | ||
500 | #define MIPS_CONF2_SS (_ULCAST_(15)<< 8) | ||
501 | #define MIPS_CONF2_SU (_ULCAST_(15)<< 12) | ||
502 | #define MIPS_CONF2_TA (_ULCAST_(15)<< 16) | ||
503 | #define MIPS_CONF2_TL (_ULCAST_(15)<< 20) | ||
504 | #define MIPS_CONF2_TS (_ULCAST_(15)<< 24) | ||
505 | #define MIPS_CONF2_TU (_ULCAST_(7) << 28) | ||
506 | |||
507 | #define MIPS_CONF3_TL (_ULCAST_(1) << 0) | ||
508 | #define MIPS_CONF3_SM (_ULCAST_(1) << 1) | ||
509 | #define MIPS_CONF3_SP (_ULCAST_(1) << 4) | ||
510 | #define MIPS_CONF3_VINT (_ULCAST_(1) << 5) | ||
511 | #define MIPS_CONF3_VEIC (_ULCAST_(1) << 6) | ||
512 | #define MIPS_CONF3_LPA (_ULCAST_(1) << 7) | ||
513 | |||
514 | /* | ||
515 | * Bits in the MIPS32/64 coprocessor 1 (FPU) revision register. | ||
516 | */ | ||
517 | #define MIPS_FPIR_S (_ULCAST_(1) << 16) | ||
518 | #define MIPS_FPIR_D (_ULCAST_(1) << 17) | ||
519 | #define MIPS_FPIR_PS (_ULCAST_(1) << 18) | ||
520 | #define MIPS_FPIR_3D (_ULCAST_(1) << 19) | ||
521 | #define MIPS_FPIR_W (_ULCAST_(1) << 20) | ||
522 | #define MIPS_FPIR_L (_ULCAST_(1) << 21) | ||
523 | #define MIPS_FPIR_F64 (_ULCAST_(1) << 22) | ||
524 | |||
525 | /* | ||
481 | * R10000 performance counter definitions. | 526 | * R10000 performance counter definitions. |
482 | * | 527 | * |
483 | * FIXME: The R10000 performance counter opens a nice way to implement CPU | 528 | * FIXME: The R10000 performance counter opens a nice way to implement CPU |