Skip to content

Commit f670840

Browse files
yu-chen-surflenb
authored andcommitted
tools/power turbostat: Support Elkhart Lake
From a turbostat point of view the Tremont-based Elkhart Lake is very similar to Goldmont, reuse the code of Goldmont. Elkhart Lake does not support 'group turbo limit counter' nor C3, adjust the code accordingly. Signed-off-by: Chen Yu <[email protected]> Signed-off-by: Len Brown <[email protected]>
1 parent d7814c3 commit f670840

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3265,6 +3265,7 @@ int probe_nhm_msrs(unsigned int family, unsigned int model)
32653265
case INTEL_FAM6_ATOM_GOLDMONT: /* BXT */
32663266
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
32673267
case INTEL_FAM6_ATOM_GOLDMONT_D: /* DNV */
3268+
case INTEL_FAM6_ATOM_TREMONT: /* EHL */
32683269
pkg_cstate_limits = glm_pkg_cstate_limits;
32693270
break;
32703271
default:
@@ -3336,6 +3337,17 @@ int is_skx(unsigned int family, unsigned int model)
33363337
}
33373338
return 0;
33383339
}
3340+
int is_ehl(unsigned int family, unsigned int model)
3341+
{
3342+
if (!genuine_intel)
3343+
return 0;
3344+
3345+
switch (model) {
3346+
case INTEL_FAM6_ATOM_TREMONT:
3347+
return 1;
3348+
}
3349+
return 0;
3350+
}
33393351

33403352
int has_turbo_ratio_limit(unsigned int family, unsigned int model)
33413353
{
@@ -3894,6 +3906,20 @@ void rapl_probe_intel(unsigned int family, unsigned int model)
38943906
else
38953907
BIC_PRESENT(BIC_PkgWatt);
38963908
break;
3909+
case INTEL_FAM6_ATOM_TREMONT: /* EHL */
3910+
do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_GFX | RAPL_PKG_POWER_INFO;
3911+
if (rapl_joules) {
3912+
BIC_PRESENT(BIC_Pkg_J);
3913+
BIC_PRESENT(BIC_Cor_J);
3914+
BIC_PRESENT(BIC_RAM_J);
3915+
BIC_PRESENT(BIC_GFX_J);
3916+
} else {
3917+
BIC_PRESENT(BIC_PkgWatt);
3918+
BIC_PRESENT(BIC_CorWatt);
3919+
BIC_PRESENT(BIC_RAMWatt);
3920+
BIC_PRESENT(BIC_GFXWatt);
3921+
}
3922+
break;
38973923
case INTEL_FAM6_SKYLAKE_L: /* SKL */
38983924
case INTEL_FAM6_CANNONLAKE_L: /* CNL */
38993925
do_rapl = RAPL_PKG | RAPL_CORES | RAPL_CORE_POLICY | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_PKG_PERF_STATUS | RAPL_GFX | RAPL_PKG_POWER_INFO;
@@ -4295,6 +4321,7 @@ int has_snb_msrs(unsigned int family, unsigned int model)
42954321
case INTEL_FAM6_ATOM_GOLDMONT: /* BXT */
42964322
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
42974323
case INTEL_FAM6_ATOM_GOLDMONT_D: /* DNV */
4324+
case INTEL_FAM6_ATOM_TREMONT: /* EHL */
42984325
return 1;
42994326
}
43004327
return 0;
@@ -4324,6 +4351,7 @@ int has_c8910_msrs(unsigned int family, unsigned int model)
43244351
case INTEL_FAM6_CANNONLAKE_L: /* CNL */
43254352
case INTEL_FAM6_ATOM_GOLDMONT: /* BXT */
43264353
case INTEL_FAM6_ATOM_GOLDMONT_PLUS:
4354+
case INTEL_FAM6_ATOM_TREMONT: /* EHL */
43274355
return 1;
43284356
}
43294357
return 0;
@@ -4882,7 +4910,8 @@ void process_cpuid()
48824910
do_slm_cstates = is_slm(family, model);
48834911
do_knl_cstates = is_knl(family, model);
48844912

4885-
if (do_slm_cstates || do_knl_cstates || is_cnl(family, model))
4913+
if (do_slm_cstates || do_knl_cstates || is_cnl(family, model) ||
4914+
is_ehl(family, model))
48864915
BIC_NOT_PRESENT(BIC_CPU_c3);
48874916

48884917
if (!quiet)

0 commit comments

Comments
 (0)