aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/power/x86/turbostat/turbostat.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 6cec6aa01241..e8b6c608d6d1 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -59,6 +59,7 @@ unsigned int do_irtl_hsw;
59unsigned int units = 1000000; /* MHz etc */ 59unsigned int units = 1000000; /* MHz etc */
60unsigned int genuine_intel; 60unsigned int genuine_intel;
61unsigned int authentic_amd; 61unsigned int authentic_amd;
62unsigned int hygon_genuine;
62unsigned int max_level, max_extended_level; 63unsigned int max_level, max_extended_level;
63unsigned int has_invariant_tsc; 64unsigned int has_invariant_tsc;
64unsigned int do_nhm_platform_info; 65unsigned int do_nhm_platform_info;
@@ -1730,7 +1731,7 @@ void get_apic_id(struct thread_data *t)
1730 if (!DO_BIC(BIC_X2APIC)) 1731 if (!DO_BIC(BIC_X2APIC))
1731 return; 1732 return;
1732 1733
1733 if (authentic_amd) { 1734 if (authentic_amd || hygon_genuine) {
1734 unsigned int topology_extensions; 1735 unsigned int topology_extensions;
1735 1736
1736 if (max_extended_level < 0x8000001e) 1737 if (max_extended_level < 0x8000001e)
@@ -3831,6 +3832,7 @@ double get_tdp_amd(unsigned int family)
3831{ 3832{
3832 switch (family) { 3833 switch (family) {
3833 case 0x17: 3834 case 0x17:
3835 case 0x18:
3834 default: 3836 default:
3835 /* This is the max stock TDP of HEDT/Server Fam17h chips */ 3837 /* This is the max stock TDP of HEDT/Server Fam17h chips */
3836 return 250.0; 3838 return 250.0;
@@ -4011,6 +4013,7 @@ void rapl_probe_amd(unsigned int family, unsigned int model)
4011 4013
4012 switch (family) { 4014 switch (family) {
4013 case 0x17: /* Zen, Zen+ */ 4015 case 0x17: /* Zen, Zen+ */
4016 case 0x18: /* Hygon Dhyana */
4014 do_rapl = RAPL_AMD_F17H | RAPL_PER_CORE_ENERGY; 4017 do_rapl = RAPL_AMD_F17H | RAPL_PER_CORE_ENERGY;
4015 if (rapl_joules) { 4018 if (rapl_joules) {
4016 BIC_PRESENT(BIC_Pkg_J); 4019 BIC_PRESENT(BIC_Pkg_J);
@@ -4047,7 +4050,7 @@ void rapl_probe(unsigned int family, unsigned int model)
4047{ 4050{
4048 if (genuine_intel) 4051 if (genuine_intel)
4049 rapl_probe_intel(family, model); 4052 rapl_probe_intel(family, model);
4050 if (authentic_amd) 4053 if (authentic_amd || hygon_genuine)
4051 rapl_probe_amd(family, model); 4054 rapl_probe_amd(family, model);
4052} 4055}
4053 4056
@@ -4632,6 +4635,8 @@ void process_cpuid()
4632 genuine_intel = 1; 4635 genuine_intel = 1;
4633 else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65) 4636 else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
4634 authentic_amd = 1; 4637 authentic_amd = 1;
4638 else if (ebx == 0x6f677948 && ecx == 0x656e6975 && edx == 0x6e65476e)
4639 hygon_genuine = 1;
4635 4640
4636 if (!quiet) 4641 if (!quiet)
4637 fprintf(outf, "CPUID(0): %.4s%.4s%.4s ", 4642 fprintf(outf, "CPUID(0): %.4s%.4s%.4s ",