Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e6807b4

Browse files
committed
xtensa: report trax and perf counters in cpuinfo
Add 'trax' to the list of CPU features when xtensa core is configured with TRAX. Add 'perf' to the list of CPU features when xtensa core is configured with perf counters and show the number of configured perf counters. Signed-off-by: Max Filippov <[email protected]>
1 parent 338d915 commit e6807b4

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

arch/xtensa/include/asm/core.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
#define XCHAL_SPANNING_WAY 0
2727
#endif
2828

29+
#ifndef XCHAL_HAVE_TRAX
30+
#define XCHAL_HAVE_TRAX 0
31+
#endif
32+
33+
#ifndef XCHAL_NUM_PERF_COUNTERS
34+
#define XCHAL_NUM_PERF_COUNTERS 0
35+
#endif
36+
2937
#if XCHAL_HAVE_WINDOWED
3038
#if defined(CONFIG_USER_ABI_DEFAULT) || defined(CONFIG_USER_ABI_CALL0_PROBE)
3139
/* Whether windowed ABI is supported in userspace. */

arch/xtensa/kernel/setup.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,12 @@ c_show(struct seq_file *f, void *slot)
586586
# if XCHAL_HAVE_OCD
587587
"ocd "
588588
# endif
589+
#if XCHAL_HAVE_TRAX
590+
"trax "
591+
#endif
592+
#if XCHAL_NUM_PERF_COUNTERS
593+
"perf "
594+
#endif
589595
#endif
590596
#if XCHAL_HAVE_DENSITY
591597
"density "
@@ -635,11 +641,13 @@ c_show(struct seq_file *f, void *slot)
635641
seq_printf(f,"physical aregs\t: %d\n"
636642
"misc regs\t: %d\n"
637643
"ibreak\t\t: %d\n"
638-
"dbreak\t\t: %d\n",
644+
"dbreak\t\t: %d\n"
645+
"perf counters\t: %d\n",
639646
XCHAL_NUM_AREGS,
640647
XCHAL_NUM_MISC_REGS,
641648
XCHAL_NUM_IBREAK,
642-
XCHAL_NUM_DBREAK);
649+
XCHAL_NUM_DBREAK,
650+
XCHAL_NUM_PERF_COUNTERS);
643651

644652

645653
/* Interrupt. */

0 commit comments

Comments
 (0)