soc: qcom: socinfo: Add support for new fields in revision 19
authorNaman Jain <quic_namajain@quicinc.com>
Tue, 6 Jun 2023 13:46:26 +0000 (19:16 +0530)
committerBjorn Andersson <andersson@kernel.org>
Tue, 13 Jun 2023 18:15:41 +0000 (11:15 -0700)
Add support for below fields coming in socinfo structure under v19:
* num_func_clusters: number of clusters with at least one functional core
* boot_cluster: cluster selected as boot cluster
* boot_core: core selected as boot core
While at it, rename some variables to align them with their
functionalities.

Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230606134626.18790-3-quic_namajain@quicinc.com
drivers/soc/qcom/socinfo.c
include/linux/soc/qcom/socinfo.h

index cb70f84..a30d8bb 100644 (file)
@@ -133,12 +133,15 @@ struct socinfo_params {
        u32 nproduct_id;
        u32 num_clusters;
        u32 ncluster_array_offset;
-       u32 num_defective_parts;
-       u32 ndefective_parts_array_offset;
+       u32 num_subset_parts;
+       u32 nsubset_parts_array_offset;
        u32 nmodem_supported;
        u32 feature_code;
        u32 pcode;
        u32 oem_variant;
+       u32 num_func_clusters;
+       u32 boot_cluster;
+       u32 boot_core;
 };
 
 struct smem_image_version {
@@ -565,6 +568,18 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
                           &qcom_socinfo->info.fmt);
 
        switch (qcom_socinfo->info.fmt) {
+       case SOCINFO_VERSION(0, 19):
+               qcom_socinfo->info.num_func_clusters = __le32_to_cpu(info->num_func_clusters);
+               qcom_socinfo->info.boot_cluster = __le32_to_cpu(info->boot_cluster);
+               qcom_socinfo->info.boot_core = __le32_to_cpu(info->boot_core);
+
+               debugfs_create_u32("num_func_clusters", 0444, qcom_socinfo->dbg_root,
+                                  &qcom_socinfo->info.num_func_clusters);
+               debugfs_create_u32("boot_cluster", 0444, qcom_socinfo->dbg_root,
+                                  &qcom_socinfo->info.boot_cluster);
+               debugfs_create_u32("boot_core", 0444, qcom_socinfo->dbg_root,
+                                  &qcom_socinfo->info.boot_core);
+               fallthrough;
        case SOCINFO_VERSION(0, 18):
        case SOCINFO_VERSION(0, 17):
                qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant);
@@ -589,17 +604,18 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
        case SOCINFO_VERSION(0, 14):
                qcom_socinfo->info.num_clusters = __le32_to_cpu(info->num_clusters);
                qcom_socinfo->info.ncluster_array_offset = __le32_to_cpu(info->ncluster_array_offset);
-               qcom_socinfo->info.num_defective_parts = __le32_to_cpu(info->num_defective_parts);
-               qcom_socinfo->info.ndefective_parts_array_offset = __le32_to_cpu(info->ndefective_parts_array_offset);
+               qcom_socinfo->info.num_subset_parts = __le32_to_cpu(info->num_subset_parts);
+               qcom_socinfo->info.nsubset_parts_array_offset =
+                       __le32_to_cpu(info->nsubset_parts_array_offset);
 
                debugfs_create_u32("num_clusters", 0444, qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.num_clusters);
                debugfs_create_u32("ncluster_array_offset", 0444, qcom_socinfo->dbg_root,
                                   &qcom_socinfo->info.ncluster_array_offset);
-               debugfs_create_u32("num_defective_parts", 0444, qcom_socinfo->dbg_root,
-                                  &qcom_socinfo->info.num_defective_parts);
-               debugfs_create_u32("ndefective_parts_array_offset", 0444, qcom_socinfo->dbg_root,
-                                  &qcom_socinfo->info.ndefective_parts_array_offset);
+               debugfs_create_u32("num_subset_parts", 0444, qcom_socinfo->dbg_root,
+                                  &qcom_socinfo->info.num_subset_parts);
+               debugfs_create_u32("nsubset_parts_array_offset", 0444, qcom_socinfo->dbg_root,
+                                  &qcom_socinfo->info.nsubset_parts_array_offset);
                fallthrough;
        case SOCINFO_VERSION(0, 13):
                qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id);
index 3cc266d..e78777b 100644 (file)
@@ -54,8 +54,8 @@ struct socinfo {
        /* Version 14 */
        __le32 num_clusters;
        __le32 ncluster_array_offset;
-       __le32 num_defective_parts;
-       __le32 ndefective_parts_array_offset;
+       __le32 num_subset_parts;
+       __le32 nsubset_parts_array_offset;
        /* Version 15 */
        __le32 nmodem_supported;
        /* Version 16 */
@@ -68,6 +68,10 @@ struct socinfo {
        /* Version 18 */
        __le32 num_kvps;
        __le32 kvps_offset;
+       /* Version 19 */
+       __le32 num_func_clusters;
+       __le32 boot_cluster;
+       __le32 boot_core;
 };
 
 #endif