diff options
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 83 |
1 files changed, 79 insertions, 4 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index f65d4c8c65a6..bb133d10b145 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -291,6 +291,12 @@ static inline int cpu_has_confreg(void) | |||
291 | #endif | 291 | #endif |
292 | } | 292 | } |
293 | 293 | ||
294 | static inline void set_elf_platform(int cpu, const char *plat) | ||
295 | { | ||
296 | if (cpu == 0) | ||
297 | __elf_platform = plat; | ||
298 | } | ||
299 | |||
294 | /* | 300 | /* |
295 | * Get the FPU Implementation/Revision. | 301 | * Get the FPU Implementation/Revision. |
296 | */ | 302 | */ |
@@ -614,6 +620,16 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu) | |||
614 | case PRID_IMP_LOONGSON2: | 620 | case PRID_IMP_LOONGSON2: |
615 | c->cputype = CPU_LOONGSON2; | 621 | c->cputype = CPU_LOONGSON2; |
616 | __cpu_name[cpu] = "ICT Loongson-2"; | 622 | __cpu_name[cpu] = "ICT Loongson-2"; |
623 | |||
624 | switch (c->processor_id & PRID_REV_MASK) { | ||
625 | case PRID_REV_LOONGSON2E: | ||
626 | set_elf_platform(cpu, "loongson2e"); | ||
627 | break; | ||
628 | case PRID_REV_LOONGSON2F: | ||
629 | set_elf_platform(cpu, "loongson2f"); | ||
630 | break; | ||
631 | } | ||
632 | |||
617 | c->isa_level = MIPS_CPU_ISA_III; | 633 | c->isa_level = MIPS_CPU_ISA_III; |
618 | c->options = R4K_OPTS | | 634 | c->options = R4K_OPTS | |
619 | MIPS_CPU_FPU | MIPS_CPU_LLSC | | 635 | MIPS_CPU_FPU | MIPS_CPU_LLSC | |
@@ -911,12 +927,14 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | |||
911 | case PRID_IMP_BMIPS32_REV8: | 927 | case PRID_IMP_BMIPS32_REV8: |
912 | c->cputype = CPU_BMIPS32; | 928 | c->cputype = CPU_BMIPS32; |
913 | __cpu_name[cpu] = "Broadcom BMIPS32"; | 929 | __cpu_name[cpu] = "Broadcom BMIPS32"; |
930 | set_elf_platform(cpu, "bmips32"); | ||
914 | break; | 931 | break; |
915 | case PRID_IMP_BMIPS3300: | 932 | case PRID_IMP_BMIPS3300: |
916 | case PRID_IMP_BMIPS3300_ALT: | 933 | case PRID_IMP_BMIPS3300_ALT: |
917 | case PRID_IMP_BMIPS3300_BUG: | 934 | case PRID_IMP_BMIPS3300_BUG: |
918 | c->cputype = CPU_BMIPS3300; | 935 | c->cputype = CPU_BMIPS3300; |
919 | __cpu_name[cpu] = "Broadcom BMIPS3300"; | 936 | __cpu_name[cpu] = "Broadcom BMIPS3300"; |
937 | set_elf_platform(cpu, "bmips3300"); | ||
920 | break; | 938 | break; |
921 | case PRID_IMP_BMIPS43XX: { | 939 | case PRID_IMP_BMIPS43XX: { |
922 | int rev = c->processor_id & 0xff; | 940 | int rev = c->processor_id & 0xff; |
@@ -925,15 +943,18 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) | |||
925 | rev <= PRID_REV_BMIPS4380_HI) { | 943 | rev <= PRID_REV_BMIPS4380_HI) { |
926 | c->cputype = CPU_BMIPS4380; | 944 | c->cputype = CPU_BMIPS4380; |
927 | __cpu_name[cpu] = "Broadcom BMIPS4380"; | 945 | __cpu_name[cpu] = "Broadcom BMIPS4380"; |
946 | set_elf_platform(cpu, "bmips4380"); | ||
928 | } else { | 947 | } else { |
929 | c->cputype = CPU_BMIPS4350; | 948 | c->cputype = CPU_BMIPS4350; |
930 | __cpu_name[cpu] = "Broadcom BMIPS4350"; | 949 | __cpu_name[cpu] = "Broadcom BMIPS4350"; |
950 | set_elf_platform(cpu, "bmips4350"); | ||
931 | } | 951 | } |
932 | break; | 952 | break; |
933 | } | 953 | } |
934 | case PRID_IMP_BMIPS5000: | 954 | case PRID_IMP_BMIPS5000: |
935 | c->cputype = CPU_BMIPS5000; | 955 | c->cputype = CPU_BMIPS5000; |
936 | __cpu_name[cpu] = "Broadcom BMIPS5000"; | 956 | __cpu_name[cpu] = "Broadcom BMIPS5000"; |
957 | set_elf_platform(cpu, "bmips5000"); | ||
937 | c->options |= MIPS_CPU_ULRI; | 958 | c->options |= MIPS_CPU_ULRI; |
938 | break; | 959 | break; |
939 | } | 960 | } |
@@ -956,14 +977,12 @@ static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu) | |||
956 | c->cputype = CPU_CAVIUM_OCTEON_PLUS; | 977 | c->cputype = CPU_CAVIUM_OCTEON_PLUS; |
957 | __cpu_name[cpu] = "Cavium Octeon+"; | 978 | __cpu_name[cpu] = "Cavium Octeon+"; |
958 | platform: | 979 | platform: |
959 | if (cpu == 0) | 980 | set_elf_platform(cpu, "octeon"); |
960 | __elf_platform = "octeon"; | ||
961 | break; | 981 | break; |
962 | case PRID_IMP_CAVIUM_CN63XX: | 982 | case PRID_IMP_CAVIUM_CN63XX: |
963 | c->cputype = CPU_CAVIUM_OCTEON2; | 983 | c->cputype = CPU_CAVIUM_OCTEON2; |
964 | __cpu_name[cpu] = "Cavium Octeon II"; | 984 | __cpu_name[cpu] = "Cavium Octeon II"; |
965 | if (cpu == 0) | 985 | set_elf_platform(cpu, "octeon2"); |
966 | __elf_platform = "octeon2"; | ||
967 | break; | 986 | break; |
968 | default: | 987 | default: |
969 | printk(KERN_INFO "Unknown Octeon chip!\n"); | 988 | printk(KERN_INFO "Unknown Octeon chip!\n"); |
@@ -988,6 +1007,59 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu) | |||
988 | } | 1007 | } |
989 | } | 1008 | } |
990 | 1009 | ||
1010 | static inline void cpu_probe_netlogic(struct cpuinfo_mips *c, int cpu) | ||
1011 | { | ||
1012 | decode_configs(c); | ||
1013 | |||
1014 | c->options = (MIPS_CPU_TLB | | ||
1015 | MIPS_CPU_4KEX | | ||
1016 | MIPS_CPU_COUNTER | | ||
1017 | MIPS_CPU_DIVEC | | ||
1018 | MIPS_CPU_WATCH | | ||
1019 | MIPS_CPU_EJTAG | | ||
1020 | MIPS_CPU_LLSC); | ||
1021 | |||
1022 | switch (c->processor_id & 0xff00) { | ||
1023 | case PRID_IMP_NETLOGIC_XLR732: | ||
1024 | case PRID_IMP_NETLOGIC_XLR716: | ||
1025 | case PRID_IMP_NETLOGIC_XLR532: | ||
1026 | case PRID_IMP_NETLOGIC_XLR308: | ||
1027 | case PRID_IMP_NETLOGIC_XLR532C: | ||
1028 | case PRID_IMP_NETLOGIC_XLR516C: | ||
1029 | case PRID_IMP_NETLOGIC_XLR508C: | ||
1030 | case PRID_IMP_NETLOGIC_XLR308C: | ||
1031 | c->cputype = CPU_XLR; | ||
1032 | __cpu_name[cpu] = "Netlogic XLR"; | ||
1033 | break; | ||
1034 | |||
1035 | case PRID_IMP_NETLOGIC_XLS608: | ||
1036 | case PRID_IMP_NETLOGIC_XLS408: | ||
1037 | case PRID_IMP_NETLOGIC_XLS404: | ||
1038 | case PRID_IMP_NETLOGIC_XLS208: | ||
1039 | case PRID_IMP_NETLOGIC_XLS204: | ||
1040 | case PRID_IMP_NETLOGIC_XLS108: | ||
1041 | case PRID_IMP_NETLOGIC_XLS104: | ||
1042 | case PRID_IMP_NETLOGIC_XLS616B: | ||
1043 | case PRID_IMP_NETLOGIC_XLS608B: | ||
1044 | case PRID_IMP_NETLOGIC_XLS416B: | ||
1045 | case PRID_IMP_NETLOGIC_XLS412B: | ||
1046 | case PRID_IMP_NETLOGIC_XLS408B: | ||
1047 | case PRID_IMP_NETLOGIC_XLS404B: | ||
1048 | c->cputype = CPU_XLR; | ||
1049 | __cpu_name[cpu] = "Netlogic XLS"; | ||
1050 | break; | ||
1051 | |||
1052 | default: | ||
1053 | printk(KERN_INFO "Unknown Netlogic chip id [%02x]!\n", | ||
1054 | c->processor_id); | ||
1055 | c->cputype = CPU_XLR; | ||
1056 | break; | ||
1057 | } | ||
1058 | |||
1059 | c->isa_level = MIPS_CPU_ISA_M64R1; | ||
1060 | c->tlbsize = ((read_c0_config1() >> 25) & 0x3f) + 1; | ||
1061 | } | ||
1062 | |||
991 | #ifdef CONFIG_64BIT | 1063 | #ifdef CONFIG_64BIT |
992 | /* For use by uaccess.h */ | 1064 | /* For use by uaccess.h */ |
993 | u64 __ua_limit; | 1065 | u64 __ua_limit; |
@@ -1035,6 +1107,9 @@ __cpuinit void cpu_probe(void) | |||
1035 | case PRID_COMP_INGENIC: | 1107 | case PRID_COMP_INGENIC: |
1036 | cpu_probe_ingenic(c, cpu); | 1108 | cpu_probe_ingenic(c, cpu); |
1037 | break; | 1109 | break; |
1110 | case PRID_COMP_NETLOGIC: | ||
1111 | cpu_probe_netlogic(c, cpu); | ||
1112 | break; | ||
1038 | } | 1113 | } |
1039 | 1114 | ||
1040 | BUG_ON(!__cpu_name[cpu]); | 1115 | BUG_ON(!__cpu_name[cpu]); |