Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Sort out CPU type to name translation.

As noticed by David Daney <ddaney@caviumnetworks.com>, the old long switch
statement did not comply with the Linux C coding style. It was also yet
another place of code to be changed when adding a new processor type
leading to annoying bugs for example in /proc/cpuinfo.

Fixed by moving the setting of the CPU type string into the core of the
probing code and a few BUG_ON() test to ensure the CPU probing code indeed
did its job and removing multiple now redundant tests.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+98 -127
+98 -127
arch/mips/kernel/cpu-probe.c
··· 286 286 #define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \ 287 287 | MIPS_CPU_COUNTER) 288 288 289 - static inline void cpu_probe_legacy(struct cpuinfo_mips *c) 289 + static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) 290 290 { 291 291 switch (c->processor_id & 0xff00) { 292 292 case PRID_IMP_R2000: 293 293 c->cputype = CPU_R2000; 294 + __cpu_name[cpu] = "R2000"; 294 295 c->isa_level = MIPS_CPU_ISA_I; 295 296 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | 296 297 MIPS_CPU_NOFPUEX; ··· 300 299 c->tlbsize = 64; 301 300 break; 302 301 case PRID_IMP_R3000: 303 - if ((c->processor_id & 0xff) == PRID_REV_R3000A) 304 - if (cpu_has_confreg()) 302 + if ((c->processor_id & 0xff) == PRID_REV_R3000A) { 303 + if (cpu_has_confreg()) { 305 304 c->cputype = CPU_R3081E; 306 - else 305 + __cpu_name[cpu] = "R3081"; 306 + } else { 307 307 c->cputype = CPU_R3000A; 308 - else 308 + __cpu_name[cpu] = "R3000A"; 309 + } 310 + break; 311 + } else { 309 312 c->cputype = CPU_R3000; 313 + __cpu_name[cpu] = "R3000"; 314 + } 310 315 c->isa_level = MIPS_CPU_ISA_I; 311 316 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | 312 317 MIPS_CPU_NOFPUEX; ··· 322 315 break; 323 316 case PRID_IMP_R4000: 324 317 if (read_c0_config() & CONF_SC) { 325 - if ((c->processor_id & 0xff) >= PRID_REV_R4400) 318 + if ((c->processor_id & 0xff) >= PRID_REV_R4400) { 326 319 c->cputype = CPU_R4400PC; 327 - else 320 + __cpu_name[cpu] = "R4400PC"; 321 + } else { 328 322 c->cputype = CPU_R4000PC; 323 + __cpu_name[cpu] = "R4000PC"; 324 + } 329 325 } else { 330 - if ((c->processor_id & 0xff) >= PRID_REV_R4400) 326 + if ((c->processor_id & 0xff) >= PRID_REV_R4400) { 331 327 c->cputype = CPU_R4400SC; 332 - else 328 + __cpu_name[cpu] = "R4400SC"; 329 + } else { 333 330 c->cputype = CPU_R4000SC; 331 + __cpu_name[cpu] = "R4000SC"; 332 + } 334 333 } 335 334 336 335 c->isa_level = MIPS_CPU_ISA_III; ··· 349 336 switch (c->processor_id & 0xf0) { 350 337 case PRID_REV_VR4111: 351 338 c->cputype = CPU_VR4111; 339 + __cpu_name[cpu] = "NEC VR4111"; 352 340 break; 353 341 case PRID_REV_VR4121: 354 342 c->cputype = CPU_VR4121; 343 + __cpu_name[cpu] = "NEC VR4121"; 355 344 break; 356 345 case PRID_REV_VR4122: 357 - if ((c->processor_id & 0xf) < 0x3) 346 + if ((c->processor_id & 0xf) < 0x3) { 358 347 c->cputype = CPU_VR4122; 359 - else 348 + __cpu_name[cpu] = "NEC VR4122"; 349 + } else { 360 350 c->cputype = CPU_VR4181A; 351 + __cpu_name[cpu] = "NEC VR4181A"; 352 + } 361 353 break; 362 354 case PRID_REV_VR4130: 363 - if ((c->processor_id & 0xf) < 0x4) 355 + if ((c->processor_id & 0xf) < 0x4) { 364 356 c->cputype = CPU_VR4131; 365 - else 357 + __cpu_name[cpu] = "NEC VR4131"; 358 + } else { 366 359 c->cputype = CPU_VR4133; 360 + __cpu_name[cpu] = "NEC VR4133"; 361 + } 367 362 break; 368 363 default: 369 364 printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 370 365 c->cputype = CPU_VR41XX; 366 + __cpu_name[cpu] = "NEC Vr41xx"; 371 367 break; 372 368 } 373 369 c->isa_level = MIPS_CPU_ISA_III; ··· 385 363 break; 386 364 case PRID_IMP_R4300: 387 365 c->cputype = CPU_R4300; 366 + __cpu_name[cpu] = "R4300"; 388 367 c->isa_level = MIPS_CPU_ISA_III; 389 368 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 390 369 MIPS_CPU_LLSC; ··· 393 370 break; 394 371 case PRID_IMP_R4600: 395 372 c->cputype = CPU_R4600; 373 + __cpu_name[cpu] = "R4600"; 396 374 c->isa_level = MIPS_CPU_ISA_III; 397 375 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 398 376 MIPS_CPU_LLSC; ··· 408 384 * it's c0_prid id number with the TX3900. 409 385 */ 410 386 c->cputype = CPU_R4650; 387 + __cpu_name[cpu] = "R4650"; 411 388 c->isa_level = MIPS_CPU_ISA_III; 412 389 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC; 413 390 c->tlbsize = 48; ··· 420 395 421 396 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) { 422 397 c->cputype = CPU_TX3927; 398 + __cpu_name[cpu] = "TX3927"; 423 399 c->tlbsize = 64; 424 400 } else { 425 401 switch (c->processor_id & 0xff) { 426 402 case PRID_REV_TX3912: 427 403 c->cputype = CPU_TX3912; 404 + __cpu_name[cpu] = "TX3912"; 428 405 c->tlbsize = 32; 429 406 break; 430 407 case PRID_REV_TX3922: 431 408 c->cputype = CPU_TX3922; 409 + __cpu_name[cpu] = "TX3922"; 432 410 c->tlbsize = 64; 433 - break; 434 - default: 435 - c->cputype = CPU_UNKNOWN; 436 411 break; 437 412 } 438 413 } 439 414 break; 440 415 case PRID_IMP_R4700: 441 416 c->cputype = CPU_R4700; 417 + __cpu_name[cpu] = "R4700"; 442 418 c->isa_level = MIPS_CPU_ISA_III; 443 419 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 444 420 MIPS_CPU_LLSC; ··· 447 421 break; 448 422 case PRID_IMP_TX49: 449 423 c->cputype = CPU_TX49XX; 424 + __cpu_name[cpu] = "R49XX"; 450 425 c->isa_level = MIPS_CPU_ISA_III; 451 426 c->options = R4K_OPTS | MIPS_CPU_LLSC; 452 427 if (!(c->processor_id & 0x08)) ··· 456 429 break; 457 430 case PRID_IMP_R5000: 458 431 c->cputype = CPU_R5000; 432 + __cpu_name[cpu] = "R5000"; 459 433 c->isa_level = MIPS_CPU_ISA_IV; 460 434 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 461 435 MIPS_CPU_LLSC; ··· 464 436 break; 465 437 case PRID_IMP_R5432: 466 438 c->cputype = CPU_R5432; 439 + __cpu_name[cpu] = "R5432"; 467 440 c->isa_level = MIPS_CPU_ISA_IV; 468 441 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 469 442 MIPS_CPU_WATCH | MIPS_CPU_LLSC; ··· 472 443 break; 473 444 case PRID_IMP_R5500: 474 445 c->cputype = CPU_R5500; 446 + __cpu_name[cpu] = "R5500"; 475 447 c->isa_level = MIPS_CPU_ISA_IV; 476 448 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 477 449 MIPS_CPU_WATCH | MIPS_CPU_LLSC; ··· 480 450 break; 481 451 case PRID_IMP_NEVADA: 482 452 c->cputype = CPU_NEVADA; 453 + __cpu_name[cpu] = "Nevada"; 483 454 c->isa_level = MIPS_CPU_ISA_IV; 484 455 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 485 456 MIPS_CPU_DIVEC | MIPS_CPU_LLSC; ··· 488 457 break; 489 458 case PRID_IMP_R6000: 490 459 c->cputype = CPU_R6000; 460 + __cpu_name[cpu] = "R6000"; 491 461 c->isa_level = MIPS_CPU_ISA_II; 492 462 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU | 493 463 MIPS_CPU_LLSC; ··· 496 464 break; 497 465 case PRID_IMP_R6000A: 498 466 c->cputype = CPU_R6000A; 467 + __cpu_name[cpu] = "R6000A"; 499 468 c->isa_level = MIPS_CPU_ISA_II; 500 469 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU | 501 470 MIPS_CPU_LLSC; ··· 504 471 break; 505 472 case PRID_IMP_RM7000: 506 473 c->cputype = CPU_RM7000; 474 + __cpu_name[cpu] = "RM7000"; 507 475 c->isa_level = MIPS_CPU_ISA_IV; 508 476 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 509 477 MIPS_CPU_LLSC; ··· 520 486 break; 521 487 case PRID_IMP_RM9000: 522 488 c->cputype = CPU_RM9000; 489 + __cpu_name[cpu] = "RM9000"; 523 490 c->isa_level = MIPS_CPU_ISA_IV; 524 491 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR | 525 492 MIPS_CPU_LLSC; ··· 535 500 break; 536 501 case PRID_IMP_R8000: 537 502 c->cputype = CPU_R8000; 503 + __cpu_name[cpu] = "RM8000"; 538 504 c->isa_level = MIPS_CPU_ISA_IV; 539 505 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | 540 506 MIPS_CPU_FPU | MIPS_CPU_32FPR | ··· 544 508 break; 545 509 case PRID_IMP_R10000: 546 510 c->cputype = CPU_R10000; 511 + __cpu_name[cpu] = "R10000"; 547 512 c->isa_level = MIPS_CPU_ISA_IV; 548 513 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 549 514 MIPS_CPU_FPU | MIPS_CPU_32FPR | ··· 554 517 break; 555 518 case PRID_IMP_R12000: 556 519 c->cputype = CPU_R12000; 520 + __cpu_name[cpu] = "R12000"; 557 521 c->isa_level = MIPS_CPU_ISA_IV; 558 522 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 559 523 MIPS_CPU_FPU | MIPS_CPU_32FPR | ··· 564 526 break; 565 527 case PRID_IMP_R14000: 566 528 c->cputype = CPU_R14000; 529 + __cpu_name[cpu] = "R14000"; 567 530 c->isa_level = MIPS_CPU_ISA_IV; 568 531 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 569 532 MIPS_CPU_FPU | MIPS_CPU_32FPR | ··· 574 535 break; 575 536 case PRID_IMP_LOONGSON2: 576 537 c->cputype = CPU_LOONGSON2; 538 + __cpu_name[cpu] = "ICT Loongson-2"; 577 539 c->isa_level = MIPS_CPU_ISA_III; 578 540 c->options = R4K_OPTS | 579 541 MIPS_CPU_FPU | MIPS_CPU_LLSC | ··· 718 678 static inline void spram_config(void) {} 719 679 #endif 720 680 721 - static inline void cpu_probe_mips(struct cpuinfo_mips *c) 681 + static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) 722 682 { 723 683 decode_configs(c); 724 684 switch (c->processor_id & 0xff00) { 725 685 case PRID_IMP_4KC: 726 686 c->cputype = CPU_4KC; 687 + __cpu_name[cpu] = "MIPS 4Kc"; 727 688 break; 728 689 case PRID_IMP_4KEC: 729 690 c->cputype = CPU_4KEC; 691 + __cpu_name[cpu] = "MIPS 4KEc"; 730 692 break; 731 693 case PRID_IMP_4KECR2: 732 694 c->cputype = CPU_4KEC; 695 + __cpu_name[cpu] = "MIPS 4KEc"; 733 696 break; 734 697 case PRID_IMP_4KSC: 735 698 case PRID_IMP_4KSD: 736 699 c->cputype = CPU_4KSC; 700 + __cpu_name[cpu] = "MIPS 4KSc"; 737 701 break; 738 702 case PRID_IMP_5KC: 739 703 c->cputype = CPU_5KC; 704 + __cpu_name[cpu] = "MIPS 5Kc"; 740 705 break; 741 706 case PRID_IMP_20KC: 742 707 c->cputype = CPU_20KC; 708 + __cpu_name[cpu] = "MIPS 20Kc"; 743 709 break; 744 710 case PRID_IMP_24K: 745 711 case PRID_IMP_24KE: 746 712 c->cputype = CPU_24K; 713 + __cpu_name[cpu] = "MIPS 24Kc"; 747 714 break; 748 715 case PRID_IMP_25KF: 749 716 c->cputype = CPU_25KF; 717 + __cpu_name[cpu] = "MIPS 25Kc"; 750 718 break; 751 719 case PRID_IMP_34K: 752 720 c->cputype = CPU_34K; 721 + __cpu_name[cpu] = "MIPS 34Kc"; 753 722 break; 754 723 case PRID_IMP_74K: 755 724 c->cputype = CPU_74K; 725 + __cpu_name[cpu] = "MIPS 74Kc"; 756 726 break; 757 727 case PRID_IMP_1004K: 758 728 c->cputype = CPU_1004K; 729 + __cpu_name[cpu] = "MIPS 1004Kc"; 759 730 break; 760 731 } 761 732 762 733 spram_config(); 763 734 } 764 735 765 - static inline void cpu_probe_alchemy(struct cpuinfo_mips *c) 736 + static inline void cpu_probe_alchemy(struct cpuinfo_mips *c, unsigned int cpu) 766 737 { 767 738 decode_configs(c); 768 739 switch (c->processor_id & 0xff00) { ··· 782 731 switch ((c->processor_id >> 24) & 0xff) { 783 732 case 0: 784 733 c->cputype = CPU_AU1000; 734 + __cpu_name[cpu] = "Au1000"; 785 735 break; 786 736 case 1: 787 737 c->cputype = CPU_AU1500; 738 + __cpu_name[cpu] = "Au1500"; 788 739 break; 789 740 case 2: 790 741 c->cputype = CPU_AU1100; 742 + __cpu_name[cpu] = "Au1100"; 791 743 break; 792 744 case 3: 793 745 c->cputype = CPU_AU1550; 746 + __cpu_name[cpu] = "Au1550"; 794 747 break; 795 748 case 4: 796 749 c->cputype = CPU_AU1200; 797 - if (2 == (c->processor_id & 0xff)) 750 + __cpu_name[cpu] = "Au1200"; 751 + if ((c->processor_id & 0xff) == 2) { 798 752 c->cputype = CPU_AU1250; 753 + __cpu_name[cpu] = "Au1250"; 754 + } 799 755 break; 800 756 case 5: 801 757 c->cputype = CPU_AU1210; 758 + __cpu_name[cpu] = "Au1210"; 802 759 break; 803 760 default: 804 761 panic("Unknown Au Core!"); ··· 816 757 } 817 758 } 818 759 819 - static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) 760 + static inline void cpu_probe_sibyte(struct cpuinfo_mips *c, unsigned int cpu) 820 761 { 821 762 decode_configs(c); 822 763 823 764 switch (c->processor_id & 0xff00) { 824 765 case PRID_IMP_SB1: 825 766 c->cputype = CPU_SB1; 767 + __cpu_name[cpu] = "SiByte SB1"; 826 768 /* FPU in pass1 is known to have issues. */ 827 769 if ((c->processor_id & 0xff) < 0x02) 828 770 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR); 829 771 break; 830 772 case PRID_IMP_SB1A: 831 773 c->cputype = CPU_SB1A; 774 + __cpu_name[cpu] = "SiByte SB1A"; 832 775 break; 833 776 } 834 777 } 835 778 836 - static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c) 779 + static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c, unsigned int cpu) 837 780 { 838 781 decode_configs(c); 839 782 switch (c->processor_id & 0xff00) { 840 783 case PRID_IMP_SR71000: 841 784 c->cputype = CPU_SR71000; 785 + __cpu_name[cpu] = "Sandcraft SR71000"; 842 786 c->scache.ways = 8; 843 787 c->tlbsize = 64; 844 788 break; 845 789 } 846 790 } 847 791 848 - static inline void cpu_probe_nxp(struct cpuinfo_mips *c) 792 + static inline void cpu_probe_nxp(struct cpuinfo_mips *c, unsigned int cpu) 849 793 { 850 794 decode_configs(c); 851 795 switch (c->processor_id & 0xff00) { 852 796 case PRID_IMP_PR4450: 853 797 c->cputype = CPU_PR4450; 798 + __cpu_name[cpu] = "Philips PR4450"; 854 799 c->isa_level = MIPS_CPU_ISA_M32R1; 855 - break; 856 - default: 857 - panic("Unknown NXP Core!"); /* REVISIT: die? */ 858 800 break; 859 801 } 860 802 } 861 803 862 - 863 - static inline void cpu_probe_broadcom(struct cpuinfo_mips *c) 804 + static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) 864 805 { 865 806 decode_configs(c); 866 807 switch (c->processor_id & 0xff00) { 867 808 case PRID_IMP_BCM3302: 868 809 c->cputype = CPU_BCM3302; 810 + __cpu_name[cpu] = "Broadcom BCM3302"; 869 811 break; 870 812 case PRID_IMP_BCM4710: 871 813 c->cputype = CPU_BCM4710; 872 - break; 873 - default: 874 - c->cputype = CPU_UNKNOWN; 814 + __cpu_name[cpu] = "Broadcom BCM4710"; 875 815 break; 876 816 } 877 817 } 878 818 879 819 const char *__cpu_name[NR_CPUS]; 880 - 881 - /* 882 - * Name a CPU 883 - */ 884 - static __cpuinit const char *cpu_to_name(struct cpuinfo_mips *c) 885 - { 886 - const char *name = NULL; 887 - 888 - switch (c->cputype) { 889 - case CPU_UNKNOWN: name = "unknown"; break; 890 - case CPU_R2000: name = "R2000"; break; 891 - case CPU_R3000: name = "R3000"; break; 892 - case CPU_R3000A: name = "R3000A"; break; 893 - case CPU_R3041: name = "R3041"; break; 894 - case CPU_R3051: name = "R3051"; break; 895 - case CPU_R3052: name = "R3052"; break; 896 - case CPU_R3081: name = "R3081"; break; 897 - case CPU_R3081E: name = "R3081E"; break; 898 - case CPU_R4000PC: name = "R4000PC"; break; 899 - case CPU_R4000SC: name = "R4000SC"; break; 900 - case CPU_R4000MC: name = "R4000MC"; break; 901 - case CPU_R4200: name = "R4200"; break; 902 - case CPU_R4400PC: name = "R4400PC"; break; 903 - case CPU_R4400SC: name = "R4400SC"; break; 904 - case CPU_R4400MC: name = "R4400MC"; break; 905 - case CPU_R4600: name = "R4600"; break; 906 - case CPU_R6000: name = "R6000"; break; 907 - case CPU_R6000A: name = "R6000A"; break; 908 - case CPU_R8000: name = "R8000"; break; 909 - case CPU_R10000: name = "R10000"; break; 910 - case CPU_R12000: name = "R12000"; break; 911 - case CPU_R14000: name = "R14000"; break; 912 - case CPU_R4300: name = "R4300"; break; 913 - case CPU_R4650: name = "R4650"; break; 914 - case CPU_R4700: name = "R4700"; break; 915 - case CPU_R5000: name = "R5000"; break; 916 - case CPU_R5000A: name = "R5000A"; break; 917 - case CPU_R4640: name = "R4640"; break; 918 - case CPU_NEVADA: name = "Nevada"; break; 919 - case CPU_RM7000: name = "RM7000"; break; 920 - case CPU_RM9000: name = "RM9000"; break; 921 - case CPU_R5432: name = "R5432"; break; 922 - case CPU_4KC: name = "MIPS 4Kc"; break; 923 - case CPU_5KC: name = "MIPS 5Kc"; break; 924 - case CPU_R4310: name = "R4310"; break; 925 - case CPU_SB1: name = "SiByte SB1"; break; 926 - case CPU_SB1A: name = "SiByte SB1A"; break; 927 - case CPU_TX3912: name = "TX3912"; break; 928 - case CPU_TX3922: name = "TX3922"; break; 929 - case CPU_TX3927: name = "TX3927"; break; 930 - case CPU_AU1000: name = "Au1000"; break; 931 - case CPU_AU1500: name = "Au1500"; break; 932 - case CPU_AU1100: name = "Au1100"; break; 933 - case CPU_AU1550: name = "Au1550"; break; 934 - case CPU_AU1200: name = "Au1200"; break; 935 - case CPU_AU1210: name = "Au1210"; break; 936 - case CPU_AU1250: name = "Au1250"; break; 937 - case CPU_4KEC: name = "MIPS 4KEc"; break; 938 - case CPU_4KSC: name = "MIPS 4KSc"; break; 939 - case CPU_VR41XX: name = "NEC Vr41xx"; break; 940 - case CPU_R5500: name = "R5500"; break; 941 - case CPU_TX49XX: name = "TX49xx"; break; 942 - case CPU_20KC: name = "MIPS 20Kc"; break; 943 - case CPU_24K: name = "MIPS 24K"; break; 944 - case CPU_25KF: name = "MIPS 25Kf"; break; 945 - case CPU_34K: name = "MIPS 34K"; break; 946 - case CPU_1004K: name = "MIPS 1004K"; break; 947 - case CPU_74K: name = "MIPS 74K"; break; 948 - case CPU_VR4111: name = "NEC VR4111"; break; 949 - case CPU_VR4121: name = "NEC VR4121"; break; 950 - case CPU_VR4122: name = "NEC VR4122"; break; 951 - case CPU_VR4131: name = "NEC VR4131"; break; 952 - case CPU_VR4133: name = "NEC VR4133"; break; 953 - case CPU_VR4181: name = "NEC VR4181"; break; 954 - case CPU_VR4181A: name = "NEC VR4181A"; break; 955 - case CPU_SR71000: name = "Sandcraft SR71000"; break; 956 - case CPU_BCM3302: name = "Broadcom BCM3302"; break; 957 - case CPU_BCM4710: name = "Broadcom BCM4710"; break; 958 - case CPU_PR4450: name = "Philips PR4450"; break; 959 - case CPU_LOONGSON2: name = "ICT Loongson-2"; break; 960 - default: 961 - BUG(); 962 - } 963 - 964 - return name; 965 - } 966 820 967 821 __cpuinit void cpu_probe(void) 968 822 { ··· 889 917 c->processor_id = read_c0_prid(); 890 918 switch (c->processor_id & 0xff0000) { 891 919 case PRID_COMP_LEGACY: 892 - cpu_probe_legacy(c); 920 + cpu_probe_legacy(c, cpu); 893 921 break; 894 922 case PRID_COMP_MIPS: 895 - cpu_probe_mips(c); 923 + cpu_probe_mips(c, cpu); 896 924 break; 897 925 case PRID_COMP_ALCHEMY: 898 - cpu_probe_alchemy(c); 926 + cpu_probe_alchemy(c, cpu); 899 927 break; 900 928 case PRID_COMP_SIBYTE: 901 - cpu_probe_sibyte(c); 929 + cpu_probe_sibyte(c, cpu); 902 930 break; 903 931 case PRID_COMP_BROADCOM: 904 - cpu_probe_broadcom(c); 932 + cpu_probe_broadcom(c, cpu); 905 933 break; 906 934 case PRID_COMP_SANDCRAFT: 907 - cpu_probe_sandcraft(c); 935 + cpu_probe_sandcraft(c, cpu); 908 936 break; 909 937 case PRID_COMP_NXP: 910 - cpu_probe_nxp(c); 938 + cpu_probe_nxp(c, cpu); 911 939 break; 912 - default: 913 - c->cputype = CPU_UNKNOWN; 914 940 } 941 + 942 + BUG_ON(!__cpu_name[cpu]); 943 + BUG_ON(c->cputype == CPU_UNKNOWN); 915 944 916 945 /* 917 946 * Platform code can force the cpu type to optimize code ··· 932 959 c->ases |= MIPS_ASE_MIPS3D; 933 960 } 934 961 } 935 - 936 - __cpu_name[cpu] = cpu_to_name(c); 937 962 938 963 if (cpu_has_mips_r2) 939 964 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;