SST BF and TF can be enabled/disabled per level. So check the current
level support from the mask of supported levels.
This change from a single level to mask for info.sst_tf_support and
info.sst_tf_support is indicated by API version change. Use as mask for
API version above 2. In this way there is no change in behavior when
running on older kernel with API version 2.
Since the tool can support now API version 3, update the supported API
version.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
static const char *version_str = "v1.18";
-static const int supported_api_ver = 2;
+static const int supported_api_ver = 3;
static struct isst_if_platform_info isst_platform_info;
static char *progname;
static int debug_flag;
if (!(info.level_mask & level_mask))
return -1;
- ctdp_level->fact_support = info.sst_tf_support;
- ctdp_level->pbf_support = info.sst_bf_support;
+ if (api_version() > 2) {
+ ctdp_level->fact_support = info.sst_tf_support & BIT(config_index);
+ ctdp_level->pbf_support = info.sst_bf_support & BIT(config_index);
+ } else {
+ ctdp_level->fact_support = info.sst_tf_support;
+ ctdp_level->pbf_support = info.sst_bf_support;
+ }
+
ctdp_level->fact_enabled = !!(info.feature_state & BIT(1));
ctdp_level->pbf_enabled = !!(info.feature_state & BIT(0));
isst_ops = mbox_get_platform_ops();
break;
case 2:
+ case 3:
isst_ops = tpmi_get_platform_ops();
break;
default: