|
3 | 3 | * Copyright (C) 2012 Regents of the University of California
|
4 | 4 | */
|
5 | 5 |
|
| 6 | +#include <linux/acpi.h> |
6 | 7 | #include <linux/cpu.h>
|
7 | 8 | #include <linux/init.h>
|
8 | 9 | #include <linux/seq_file.h>
|
9 | 10 | #include <linux/of.h>
|
| 11 | +#include <asm/acpi.h> |
10 | 12 | #include <asm/cpufeature.h>
|
11 | 13 | #include <asm/csr.h>
|
12 | 14 | #include <asm/hwcap.h>
|
@@ -283,23 +285,35 @@ static void c_stop(struct seq_file *m, void *v)
|
283 | 285 | static int c_show(struct seq_file *m, void *v)
|
284 | 286 | {
|
285 | 287 | unsigned long cpu_id = (unsigned long)v - 1;
|
286 |
| - struct device_node *node = of_get_cpu_node(cpu_id, NULL); |
287 | 288 | struct riscv_cpuinfo *ci = per_cpu_ptr(&riscv_cpuinfo, cpu_id);
|
| 289 | + struct device_node *node; |
288 | 290 | const char *compat, *isa;
|
289 | 291 |
|
290 | 292 | seq_printf(m, "processor\t: %lu\n", cpu_id);
|
291 | 293 | seq_printf(m, "hart\t\t: %lu\n", cpuid_to_hartid_map(cpu_id));
|
292 |
| - if (!of_property_read_string(node, "riscv,isa", &isa)) |
293 |
| - print_isa(m, isa); |
294 |
| - print_mmu(m); |
295 |
| - if (!of_property_read_string(node, "compatible", &compat) |
296 |
| - && strcmp(compat, "riscv")) |
297 |
| - seq_printf(m, "uarch\t\t: %s\n", compat); |
| 294 | + |
| 295 | + if (acpi_disabled) { |
| 296 | + node = of_get_cpu_node(cpu_id, NULL); |
| 297 | + if (!of_property_read_string(node, "riscv,isa", &isa)) |
| 298 | + print_isa(m, isa); |
| 299 | + |
| 300 | + print_mmu(m); |
| 301 | + if (!of_property_read_string(node, "compatible", &compat) && |
| 302 | + strcmp(compat, "riscv")) |
| 303 | + seq_printf(m, "uarch\t\t: %s\n", compat); |
| 304 | + |
| 305 | + of_node_put(node); |
| 306 | + } else { |
| 307 | + if (!acpi_get_riscv_isa(NULL, cpu_id, &isa)) |
| 308 | + print_isa(m, isa); |
| 309 | + |
| 310 | + print_mmu(m); |
| 311 | + } |
| 312 | + |
298 | 313 | seq_printf(m, "mvendorid\t: 0x%lx\n", ci->mvendorid);
|
299 | 314 | seq_printf(m, "marchid\t\t: 0x%lx\n", ci->marchid);
|
300 | 315 | seq_printf(m, "mimpid\t\t: 0x%lx\n", ci->mimpid);
|
301 | 316 | seq_puts(m, "\n");
|
302 |
| - of_node_put(node); |
303 | 317 |
|
304 | 318 | return 0;
|
305 | 319 | }
|
|
0 commit comments