Lines Matching +full:cpu +full:- +full:cfg
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (C) 1994 - 2006 Ralf Baechle
18 #include <asm/cpu.h>
19 #include <asm/cpu-features.h>
20 #include <asm/cpu-type.h>
26 #include "fpu-probe.h"
38 * Probe whether cpu has config register by trying to play with
46 unsigned long cfg = read_c0_conf(); in cpu_has_confreg() local
49 write_c0_conf(cfg ^ R30XX_CONF_AC); in cpu_has_confreg()
51 write_c0_conf(cfg); in cpu_has_confreg()
58 static inline void set_elf_platform(int cpu, const char *plat) in set_elf_platform() argument
60 if (cpu == 0) in set_elf_platform()
71 unsigned int cpu = smp_processor_id(); in cpu_probe() local
74 * Set a default elf platform, cpu probe may later in cpu_probe()
77 set_elf_platform(cpu, "mips"); in cpu_probe()
79 c->processor_id = PRID_IMP_UNKNOWN; in cpu_probe()
80 c->fpu_id = FPIR_IMP_NONE; in cpu_probe()
81 c->cputype = CPU_UNKNOWN; in cpu_probe()
82 c->writecombine = _CACHE_UNCACHED; in cpu_probe()
84 c->fpu_csr31 = FPU_CSR_RN; in cpu_probe()
85 c->fpu_msk31 = FPU_CSR_RSVD | FPU_CSR_ABS2008 | FPU_CSR_NAN2008 | in cpu_probe()
88 c->srsets = 1; in cpu_probe()
90 c->processor_id = read_c0_prid(); in cpu_probe()
91 switch (c->processor_id & (PRID_COMP_MASK | PRID_IMP_MASK)) { in cpu_probe()
93 c->cputype = CPU_R2000; in cpu_probe()
94 __cpu_name[cpu] = "R2000"; in cpu_probe()
95 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe()
98 c->options |= MIPS_CPU_FPU; in cpu_probe()
99 c->tlbsize = 64; in cpu_probe()
102 if ((c->processor_id & PRID_REV_MASK) == PRID_REV_R3000A) { in cpu_probe()
104 c->cputype = CPU_R3081E; in cpu_probe()
105 __cpu_name[cpu] = "R3081"; in cpu_probe()
107 c->cputype = CPU_R3000A; in cpu_probe()
108 __cpu_name[cpu] = "R3000A"; in cpu_probe()
111 c->cputype = CPU_R3000; in cpu_probe()
112 __cpu_name[cpu] = "R3000"; in cpu_probe()
114 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE | in cpu_probe()
117 c->options |= MIPS_CPU_FPU; in cpu_probe()
118 c->tlbsize = 64; in cpu_probe()
122 BUG_ON(!__cpu_name[cpu]); in cpu_probe()
123 BUG_ON(c->cputype == CPU_UNKNOWN); in cpu_probe()
126 * Platform code can force the cpu type to optimize code in cpu_probe()
127 * generation. In that case be sure the cpu type is correctly in cpu_probe()
130 BUG_ON(current_cpu_type() != c->cputype); in cpu_probe()
133 c->options &= ~MIPS_CPU_FPU; in cpu_probe()
135 if (c->options & MIPS_CPU_FPU) in cpu_probe()
147 pr_info("CPU%d revision is: %08x (%s)\n", in cpu_report()
148 smp_processor_id(), c->processor_id, cpu_name_string()); in cpu_report()
149 if (c->options & MIPS_CPU_FPU) in cpu_report()
150 pr_info("FPU revision is: %08x\n", c->fpu_id); in cpu_report()