* [PATCH 0/2] platform/x86: ISST: SST PP and TF revision 2
@ 2025-04-17 17:00 Srinivas Pandruvada
2025-04-17 17:00 ` [PATCH 1/2] platform/x86: ISST: Support SST-TF " Srinivas Pandruvada
2025-04-17 17:00 ` [PATCH 2/2] platform/x86: ISST: Support SST-PP " Srinivas Pandruvada
0 siblings, 2 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2025-04-17 17:00 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen
Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada
Add support for SST PP and TF revison 2 support.
Srinivas Pandruvada (2):
platform/x86: ISST: Support SST-TF revision 2
platform/x86: ISST: Support SST-PP revision 2
.../intel/speed_select_if/isst_tpmi_core.c | 99 +++++++++++++++++++
include/uapi/linux/isst_if.h | 26 +++++
2 files changed, 125 insertions(+)
--
2.48.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] platform/x86: ISST: Support SST-TF revision 2
2025-04-17 17:00 [PATCH 0/2] platform/x86: ISST: SST PP and TF revision 2 Srinivas Pandruvada
@ 2025-04-17 17:00 ` Srinivas Pandruvada
2025-04-29 14:23 ` Ilpo Järvinen
2025-04-17 17:00 ` [PATCH 2/2] platform/x86: ISST: Support SST-PP " Srinivas Pandruvada
1 sibling, 1 reply; 5+ messages in thread
From: Srinivas Pandruvada @ 2025-04-17 17:00 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen
Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada
SST-TF revision 2 supports a higher number of cores per bucket, as the
current limit of 256 cores may be insufficient. To accommodate this, a
new offset, "SST_TF_INFO-8," is introduced, allowing for a higher core
count. Utilize this offset instead of the current "SST_TF_INFO-1" offset,
based on SST-TF revision 2 or higher, and if there is a non-zero core
count in any bucket.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
.../intel/speed_select_if/isst_tpmi_core.c | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index 9978cdd19851..bc4089d3d421 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -1328,9 +1328,14 @@ static int isst_if_get_tpmi_instance_count(void __user *argp)
#define SST_TF_INFO_0_OFFSET 0
#define SST_TF_INFO_1_OFFSET 8
#define SST_TF_INFO_2_OFFSET 16
+#define SST_TF_INFO_8_OFFSET 64
+#define SST_TF_INFO_8_BUCKETS 3
#define SST_TF_MAX_LP_CLIP_RATIOS TRL_MAX_LEVELS
+#define SST_TF_FEATURE_REV_START 4
+#define SST_TF_FEATURE_REV_WIDTH 8
+
#define SST_TF_LP_CLIP_RATIO_0_START 16
#define SST_TF_LP_CLIP_RATIO_0_WIDTH 8
@@ -1340,10 +1345,14 @@ static int isst_if_get_tpmi_instance_count(void __user *argp)
#define SST_TF_NUM_CORE_0_START 0
#define SST_TF_NUM_CORE_0_WIDTH 8
+#define SST_TF_NUM_MOD_0_START 0
+#define SST_TF_NUM_MOD_0_WIDTH 16
+
static int isst_if_get_turbo_freq_info(void __user *argp)
{
static struct isst_turbo_freq_info turbo_freq;
struct tpmi_per_power_domain_info *power_domain_info;
+ u8 feature_rev;
int i, j;
if (copy_from_user(&turbo_freq, argp, sizeof(turbo_freq)))
@@ -1360,6 +1369,10 @@ static int isst_if_get_turbo_freq_info(void __user *argp)
turbo_freq.max_trl_levels = TRL_MAX_LEVELS;
turbo_freq.max_clip_freqs = SST_TF_MAX_LP_CLIP_RATIOS;
+ _read_tf_level_info("feature_rev", feature_rev, turbo_freq.level,
+ SST_TF_INFO_0_OFFSET, SST_TF_FEATURE_REV_START,
+ SST_TF_FEATURE_REV_WIDTH, SST_MUL_FACTOR_NONE);
+
for (i = 0; i < turbo_freq.max_clip_freqs; ++i)
_read_tf_level_info("lp_clip*", turbo_freq.lp_clip_freq_mhz[i],
turbo_freq.level, SST_TF_INFO_0_OFFSET,
@@ -1376,12 +1389,32 @@ static int isst_if_get_turbo_freq_info(void __user *argp)
SST_MUL_FACTOR_FREQ)
}
+ if (feature_rev >= 2) {
+ bool valid = false;
+
+ for (i = 0; i < SST_TF_INFO_8_BUCKETS; ++i) {
+ _read_tf_level_info("bucket_*_mod_count", turbo_freq.bucket_core_counts[i],
+ turbo_freq.level, SST_TF_INFO_8_OFFSET,
+ SST_TF_NUM_MOD_0_WIDTH * i, SST_TF_NUM_MOD_0_WIDTH,
+ SST_MUL_FACTOR_NONE)
+
+ if (!valid && turbo_freq.bucket_core_counts[i])
+ valid = true;
+ }
+
+ if (valid)
+ goto done_core_count;
+ }
+
for (i = 0; i < TRL_MAX_BUCKETS; ++i)
_read_tf_level_info("bucket_*_core_count", turbo_freq.bucket_core_counts[i],
turbo_freq.level, SST_TF_INFO_1_OFFSET,
SST_TF_NUM_CORE_0_WIDTH * i, SST_TF_NUM_CORE_0_WIDTH,
SST_MUL_FACTOR_NONE)
+
+done_core_count:
+
if (copy_to_user(argp, &turbo_freq, sizeof(turbo_freq)))
return -EFAULT;
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] platform/x86: ISST: Support SST-PP revision 2
2025-04-17 17:00 [PATCH 0/2] platform/x86: ISST: SST PP and TF revision 2 Srinivas Pandruvada
2025-04-17 17:00 ` [PATCH 1/2] platform/x86: ISST: Support SST-TF " Srinivas Pandruvada
@ 2025-04-17 17:00 ` Srinivas Pandruvada
1 sibling, 0 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2025-04-17 17:00 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen
Cc: platform-driver-x86, linux-kernel, Srinivas Pandruvada
SST PP revision 2 added fabric 1 P0, P1 and Pm frequencies. Export them
by using a new IOCTL ISST_IF_GET_PERF_LEVEL_FABRIC_INFO. This IOCTL
requires platforms with SST PP revision 2 or higher.
To accommodate potential future increases in fabric count and avoid ABI
changes, support is extended for up to 8 fabrics.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
.../intel/speed_select_if/isst_tpmi_core.c | 66 +++++++++++++++++++
include/uapi/linux/isst_if.h | 26 ++++++++
2 files changed, 92 insertions(+)
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index bc4089d3d421..b868ea0ce8f6 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -1016,6 +1016,7 @@ static int isst_if_set_perf_feature(void __user *argp)
#define SST_PP_INFO_10_OFFSET 80
#define SST_PP_INFO_11_OFFSET 88
+#define SST_PP_INFO_12_OFFSET 96
#define SST_PP_P1_SSE_START 0
#define SST_PP_P1_SSE_WIDTH 8
@@ -1068,6 +1069,15 @@ static int isst_if_set_perf_feature(void __user *argp)
#define SST_PP_CORE_RATIO_PM_FABRIC_START 48
#define SST_PP_CORE_RATIO_PM_FABRIC_WIDTH 8
+#define SST_PP_CORE_RATIO_P0_FABRIC_1_START 0
+#define SST_PP_CORE_RATIO_P0_FABRIC_1_WIDTH 8
+
+#define SST_PP_CORE_RATIO_P1_FABRIC_1_START 8
+#define SST_PP_CORE_RATIO_P1_FABRIC_1_WIDTH 8
+
+#define SST_PP_CORE_RATIO_PM_FABRIC_1_START 16
+#define SST_PP_CORE_RATIO_PM_FABRIC_1_WIDTH 8
+
static int isst_if_get_perf_level_info(void __user *argp)
{
struct isst_perf_level_data_info perf_level;
@@ -1167,6 +1177,59 @@ static int isst_if_get_perf_level_info(void __user *argp)
return 0;
}
+static int isst_if_get_perf_level_fabric_info(void __user *argp)
+{
+ struct isst_perf_level_fabric_info perf_level_fabric;
+ struct tpmi_per_power_domain_info *power_domain_info;
+ int start = SST_PP_CORE_RATIO_P0_FABRIC_START;
+ int width = SST_PP_CORE_RATIO_P0_FABRIC_WIDTH;
+ int offset = SST_PP_INFO_11_OFFSET;
+ int i;
+
+ if (copy_from_user(&perf_level_fabric, argp, sizeof(perf_level_fabric)))
+ return -EFAULT;
+
+ power_domain_info = get_instance(perf_level_fabric.socket_id,
+ perf_level_fabric.power_domain_id);
+ if (!power_domain_info)
+ return -EINVAL;
+
+ if (perf_level_fabric.level > power_domain_info->max_level)
+ return -EINVAL;
+
+ if (power_domain_info->pp_header.feature_rev < 2)
+ return -EINVAL;
+
+ if (!(power_domain_info->pp_header.level_en_mask & BIT(perf_level_fabric.level)))
+ return -EINVAL;
+
+ /* For revision 2, maximum number of fabrics is 2 */
+ perf_level_fabric.max_fabrics = 2;
+
+ for (i = 0; i < perf_level_fabric.max_fabrics; i++) {
+ _read_pp_level_info("p0_fabric_freq_mhz", perf_level_fabric.p0_fabric_freq_mhz[i],
+ perf_level_fabric.level, offset, start, width,
+ SST_MUL_FACTOR_FREQ)
+ start += width;
+
+ _read_pp_level_info("p1_fabric_freq_mhz", perf_level_fabric.p1_fabric_freq_mhz[i],
+ perf_level_fabric.level, offset, start, width,
+ SST_MUL_FACTOR_FREQ)
+ start += width;
+
+ _read_pp_level_info("pm_fabric_freq_mhz", perf_level_fabric.pm_fabric_freq_mhz[i],
+ perf_level_fabric.level, offset, start, width,
+ SST_MUL_FACTOR_FREQ)
+ offset = SST_PP_INFO_12_OFFSET;
+ start = 0;
+ }
+
+ if (copy_to_user(argp, &perf_level_fabric, sizeof(perf_level_fabric)))
+ return -EFAULT;
+
+ return 0;
+}
+
#define SST_PP_FUSED_CORE_COUNT_START 0
#define SST_PP_FUSED_CORE_COUNT_WIDTH 8
@@ -1453,6 +1516,9 @@ static long isst_if_def_ioctl(struct file *file, unsigned int cmd,
case ISST_IF_GET_PERF_LEVEL_INFO:
ret = isst_if_get_perf_level_info(argp);
break;
+ case ISST_IF_GET_PERF_LEVEL_FABRIC_INFO:
+ ret = isst_if_get_perf_level_fabric_info(argp);
+ break;
case ISST_IF_GET_PERF_LEVEL_CPU_MASK:
ret = isst_if_get_perf_level_mask(argp);
break;
diff --git a/include/uapi/linux/isst_if.h b/include/uapi/linux/isst_if.h
index 0df1a1c3caf4..8197a4800604 100644
--- a/include/uapi/linux/isst_if.h
+++ b/include/uapi/linux/isst_if.h
@@ -375,6 +375,30 @@ struct isst_perf_level_data_info {
__u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS];
};
+#define MAX_FABRIC_COUNT 8
+
+/**
+ * struct isst_perf_level_fabric_info - Structure to get SST-PP fabric details
+ * @socket_id: Socket/package id
+ * @power_domain_id: Power Domain id
+ * @level: SST-PP level for which caller wants to get information
+ * @max_fabrics: Count of fabrics in resonse
+ * @p0_fabric_freq_mhz: Fabric (Uncore) maximum frequency
+ * @p1_fabric_freq_mhz: Fabric (Uncore) TDP frequency
+ * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency
+ *
+ * Structure used to get information on frequencies for fabrics.
+ */
+struct isst_perf_level_fabric_info {
+ __u8 socket_id;
+ __u8 power_domain_id;
+ __u16 level;
+ __u16 max_fabrics;
+ __u16 p0_fabric_freq_mhz[MAX_FABRIC_COUNT];
+ __u16 p1_fabric_freq_mhz[MAX_FABRIC_COUNT];
+ __u16 pm_fabric_freq_mhz[MAX_FABRIC_COUNT];
+};
+
/**
* struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask
* @socket_id: Socket/package id
@@ -471,5 +495,7 @@ struct isst_turbo_freq_info {
#define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *)
#define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *)
#define ISST_IF_GET_TURBO_FREQ_INFO _IOR(ISST_IF_MAGIC, 16, struct isst_turbo_freq_info *)
+#define ISST_IF_GET_PERF_LEVEL_FABRIC_INFO _IOR(ISST_IF_MAGIC, 17,\
+ struct isst_perf_level_fabric_info *)
#endif
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] platform/x86: ISST: Support SST-TF revision 2
2025-04-17 17:00 ` [PATCH 1/2] platform/x86: ISST: Support SST-TF " Srinivas Pandruvada
@ 2025-04-29 14:23 ` Ilpo Järvinen
2025-04-29 17:29 ` srinivas pandruvada
0 siblings, 1 reply; 5+ messages in thread
From: Ilpo Järvinen @ 2025-04-29 14:23 UTC (permalink / raw)
To: Srinivas Pandruvada; +Cc: Hans de Goede, platform-driver-x86, LKML
On Thu, 17 Apr 2025, Srinivas Pandruvada wrote:
> SST-TF revision 2 supports a higher number of cores per bucket, as the
> current limit of 256 cores may be insufficient. To accommodate this, a
> new offset, "SST_TF_INFO-8," is introduced, allowing for a higher core
> count. Utilize this offset instead of the current "SST_TF_INFO-1" offset,
> based on SST-TF revision 2 or higher, and if there is a non-zero core
> count in any bucket.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
> .../intel/speed_select_if/isst_tpmi_core.c | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> index 9978cdd19851..bc4089d3d421 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> @@ -1328,9 +1328,14 @@ static int isst_if_get_tpmi_instance_count(void __user *argp)
> #define SST_TF_INFO_0_OFFSET 0
> #define SST_TF_INFO_1_OFFSET 8
> #define SST_TF_INFO_2_OFFSET 16
> +#define SST_TF_INFO_8_OFFSET 64
> +#define SST_TF_INFO_8_BUCKETS 3
>
> #define SST_TF_MAX_LP_CLIP_RATIOS TRL_MAX_LEVELS
>
> +#define SST_TF_FEATURE_REV_START 4
> +#define SST_TF_FEATURE_REV_WIDTH 8
> +
> #define SST_TF_LP_CLIP_RATIO_0_START 16
> #define SST_TF_LP_CLIP_RATIO_0_WIDTH 8
>
> @@ -1340,10 +1345,14 @@ static int isst_if_get_tpmi_instance_count(void __user *argp)
> #define SST_TF_NUM_CORE_0_START 0
> #define SST_TF_NUM_CORE_0_WIDTH 8
>
> +#define SST_TF_NUM_MOD_0_START 0
> +#define SST_TF_NUM_MOD_0_WIDTH 16
> +
> static int isst_if_get_turbo_freq_info(void __user *argp)
> {
> static struct isst_turbo_freq_info turbo_freq;
> struct tpmi_per_power_domain_info *power_domain_info;
> + u8 feature_rev;
> int i, j;
>
> if (copy_from_user(&turbo_freq, argp, sizeof(turbo_freq)))
> @@ -1360,6 +1369,10 @@ static int isst_if_get_turbo_freq_info(void __user *argp)
> turbo_freq.max_trl_levels = TRL_MAX_LEVELS;
> turbo_freq.max_clip_freqs = SST_TF_MAX_LP_CLIP_RATIOS;
>
> + _read_tf_level_info("feature_rev", feature_rev, turbo_freq.level,
> + SST_TF_INFO_0_OFFSET, SST_TF_FEATURE_REV_START,
> + SST_TF_FEATURE_REV_WIDTH, SST_MUL_FACTOR_NONE);
> +
> for (i = 0; i < turbo_freq.max_clip_freqs; ++i)
> _read_tf_level_info("lp_clip*", turbo_freq.lp_clip_freq_mhz[i],
> turbo_freq.level, SST_TF_INFO_0_OFFSET,
> @@ -1376,12 +1389,32 @@ static int isst_if_get_turbo_freq_info(void __user *argp)
> SST_MUL_FACTOR_FREQ)
> }
>
> + if (feature_rev >= 2) {
> + bool valid = false;
> +
> + for (i = 0; i < SST_TF_INFO_8_BUCKETS; ++i) {
> + _read_tf_level_info("bucket_*_mod_count", turbo_freq.bucket_core_counts[i],
> + turbo_freq.level, SST_TF_INFO_8_OFFSET,
> + SST_TF_NUM_MOD_0_WIDTH * i, SST_TF_NUM_MOD_0_WIDTH,
> + SST_MUL_FACTOR_NONE)
> +
> + if (!valid && turbo_freq.bucket_core_counts[i])
I'd just drop !valid from this check.
> + valid = true;
> + }
> +
> + if (valid)
Should this be named instead to something like has_tf_info_8 ? (As this is
not really valid/invalid check but whether this new info exists or not.)
> + goto done_core_count;
> + }
> +
> for (i = 0; i < TRL_MAX_BUCKETS; ++i)
> _read_tf_level_info("bucket_*_core_count", turbo_freq.bucket_core_counts[i],
> turbo_freq.level, SST_TF_INFO_1_OFFSET,
> SST_TF_NUM_CORE_0_WIDTH * i, SST_TF_NUM_CORE_0_WIDTH,
> SST_MUL_FACTOR_NONE)
>
> +
> +done_core_count:
> +
> if (copy_to_user(argp, &turbo_freq, sizeof(turbo_freq)))
> return -EFAULT;
>
>
--
i.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] platform/x86: ISST: Support SST-TF revision 2
2025-04-29 14:23 ` Ilpo Järvinen
@ 2025-04-29 17:29 ` srinivas pandruvada
0 siblings, 0 replies; 5+ messages in thread
From: srinivas pandruvada @ 2025-04-29 17:29 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: Hans de Goede, platform-driver-x86, LKML
On Tue, 2025-04-29 at 17:23 +0300, Ilpo Järvinen wrote:
> On Thu, 17 Apr 2025, Srinivas Pandruvada wrote:
>
> > SST-TF revision 2 supports a higher number of cores per bucket, as
> > the
> > current limit of 256 cores may be insufficient. To accommodate
> > this, a
> > new offset, "SST_TF_INFO-8," is introduced, allowing for a higher
> > core
> > count. Utilize this offset instead of the current "SST_TF_INFO-1"
> > offset,
> > based on SST-TF revision 2 or higher, and if there is a non-zero
> > core
> > count in any bucket.
> >
...
> > + if (feature_rev >= 2) {
> > + bool valid = false;
> > +
> > + for (i = 0; i < SST_TF_INFO_8_BUCKETS; ++i) {
> > + _read_tf_level_info("bucket_*_mod_count",
> > turbo_freq.bucket_core_counts[i],
> > + turbo_freq.level,
> > SST_TF_INFO_8_OFFSET,
> > + SST_TF_NUM_MOD_0_WIDTH
> > * i, SST_TF_NUM_MOD_0_WIDTH,
> > + SST_MUL_FACTOR_NONE)
> > +
> > + if (!valid &&
> > turbo_freq.bucket_core_counts[i])
>
> I'd just drop !valid from this check.
>
> > + valid = true;
> > + }
> > +
> > + if (valid)
>
>
> Should this be named instead to something like has_tf_info_8 ? (As
> this is
> not really valid/invalid check but whether this new info exists or
> not.)
We can.
Thanks,
Srinivas
>
> > + goto done_core_count;
> > + }
> > +
> > for (i = 0; i < TRL_MAX_BUCKETS; ++i)
> > _read_tf_level_info("bucket_*_core_count",
> > turbo_freq.bucket_core_counts[i],
> > turbo_freq.level,
> > SST_TF_INFO_1_OFFSET,
> > SST_TF_NUM_CORE_0_WIDTH * i,
> > SST_TF_NUM_CORE_0_WIDTH,
> > SST_MUL_FACTOR_NONE)
> >
> > +
> > +done_core_count:
> > +
> > if (copy_to_user(argp, &turbo_freq, sizeof(turbo_freq)))
> > return -EFAULT;
> >
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-29 17:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 17:00 [PATCH 0/2] platform/x86: ISST: SST PP and TF revision 2 Srinivas Pandruvada
2025-04-17 17:00 ` [PATCH 1/2] platform/x86: ISST: Support SST-TF " Srinivas Pandruvada
2025-04-29 14:23 ` Ilpo Järvinen
2025-04-29 17:29 ` srinivas pandruvada
2025-04-17 17:00 ` [PATCH 2/2] platform/x86: ISST: Support SST-PP " Srinivas Pandruvada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox