| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * (C) 2004-2009 Dominik Brodowski <linux@dominikbrodowski.de> |
|---|
| 3 | | - * |
|---|
| 4 | | - * Licensed under the terms of the GNU GPL License version 2. |
|---|
| 5 | 4 | */ |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | |
|---|
| .. | .. |
|---|
| 161 | 160 | return; |
|---|
| 162 | 161 | } |
|---|
| 163 | 162 | |
|---|
| 164 | | -/* --boost / -b */ |
|---|
| 165 | | - |
|---|
| 166 | | -static int get_boost_mode(unsigned int cpu) |
|---|
| 163 | +static int get_boost_mode_x86(unsigned int cpu) |
|---|
| 167 | 164 | { |
|---|
| 168 | 165 | int support, active, b_states = 0, ret, pstate_no, i; |
|---|
| 169 | 166 | /* ToDo: Make this more global */ |
|---|
| 170 | 167 | unsigned long pstates[MAX_HW_PSTATES] = {0,}; |
|---|
| 171 | | - |
|---|
| 172 | | - if (cpupower_cpu_info.vendor != X86_VENDOR_AMD && |
|---|
| 173 | | - cpupower_cpu_info.vendor != X86_VENDOR_INTEL) |
|---|
| 174 | | - return 0; |
|---|
| 175 | 168 | |
|---|
| 176 | 169 | ret = cpufreq_has_boost_support(cpu, &support, &active, &b_states); |
|---|
| 177 | 170 | if (ret) { |
|---|
| .. | .. |
|---|
| 190 | 183 | printf(_(" Supported: %s\n"), support ? _("yes") : _("no")); |
|---|
| 191 | 184 | printf(_(" Active: %s\n"), active ? _("yes") : _("no")); |
|---|
| 192 | 185 | |
|---|
| 193 | | - if (cpupower_cpu_info.vendor == X86_VENDOR_AMD && |
|---|
| 194 | | - cpupower_cpu_info.family >= 0x10) { |
|---|
| 186 | + if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD && |
|---|
| 187 | + cpupower_cpu_info.family >= 0x10) || |
|---|
| 188 | + cpupower_cpu_info.vendor == X86_VENDOR_HYGON) { |
|---|
| 195 | 189 | ret = decode_pstates(cpu, cpupower_cpu_info.family, b_states, |
|---|
| 196 | 190 | pstates, &pstate_no); |
|---|
| 197 | 191 | if (ret) |
|---|
| .. | .. |
|---|
| 246 | 240 | return 0; |
|---|
| 247 | 241 | } |
|---|
| 248 | 242 | |
|---|
| 243 | +/* --boost / -b */ |
|---|
| 244 | + |
|---|
| 245 | +static int get_boost_mode(unsigned int cpu) |
|---|
| 246 | +{ |
|---|
| 247 | + struct cpufreq_available_frequencies *freqs; |
|---|
| 248 | + |
|---|
| 249 | + if (cpupower_cpu_info.vendor == X86_VENDOR_AMD || |
|---|
| 250 | + cpupower_cpu_info.vendor == X86_VENDOR_HYGON || |
|---|
| 251 | + cpupower_cpu_info.vendor == X86_VENDOR_INTEL) |
|---|
| 252 | + return get_boost_mode_x86(cpu); |
|---|
| 253 | + |
|---|
| 254 | + freqs = cpufreq_get_boost_frequencies(cpu); |
|---|
| 255 | + if (freqs) { |
|---|
| 256 | + printf(_(" boost frequency steps: ")); |
|---|
| 257 | + while (freqs->next) { |
|---|
| 258 | + print_speed(freqs->frequency); |
|---|
| 259 | + printf(", "); |
|---|
| 260 | + freqs = freqs->next; |
|---|
| 261 | + } |
|---|
| 262 | + print_speed(freqs->frequency); |
|---|
| 263 | + printf("\n"); |
|---|
| 264 | + cpufreq_put_available_frequencies(freqs); |
|---|
| 265 | + } |
|---|
| 266 | + |
|---|
| 267 | + return 0; |
|---|
| 268 | +} |
|---|
| 269 | + |
|---|
| 249 | 270 | /* --freq / -f */ |
|---|
| 250 | 271 | |
|---|
| 251 | 272 | static int get_freq_kernel(unsigned int cpu, unsigned int human) |
|---|