Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: qcom: socinfo: Add support for new fields in revision 19

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

authored by

Naman Jain and committed by
Bjorn Andersson
d9c2a255 158826c7

+30 -10
+24 -8
drivers/soc/qcom/socinfo.c
··· 133 133 u32 nproduct_id; 134 134 u32 num_clusters; 135 135 u32 ncluster_array_offset; 136 - u32 num_defective_parts; 137 - u32 ndefective_parts_array_offset; 136 + u32 num_subset_parts; 137 + u32 nsubset_parts_array_offset; 138 138 u32 nmodem_supported; 139 139 u32 feature_code; 140 140 u32 pcode; 141 141 u32 oem_variant; 142 + u32 num_func_clusters; 143 + u32 boot_cluster; 144 + u32 boot_core; 142 145 }; 143 146 144 147 struct smem_image_version { ··· 568 565 &qcom_socinfo->info.fmt); 569 566 570 567 switch (qcom_socinfo->info.fmt) { 568 + case SOCINFO_VERSION(0, 19): 569 + qcom_socinfo->info.num_func_clusters = __le32_to_cpu(info->num_func_clusters); 570 + qcom_socinfo->info.boot_cluster = __le32_to_cpu(info->boot_cluster); 571 + qcom_socinfo->info.boot_core = __le32_to_cpu(info->boot_core); 572 + 573 + debugfs_create_u32("num_func_clusters", 0444, qcom_socinfo->dbg_root, 574 + &qcom_socinfo->info.num_func_clusters); 575 + debugfs_create_u32("boot_cluster", 0444, qcom_socinfo->dbg_root, 576 + &qcom_socinfo->info.boot_cluster); 577 + debugfs_create_u32("boot_core", 0444, qcom_socinfo->dbg_root, 578 + &qcom_socinfo->info.boot_core); 579 + fallthrough; 571 580 case SOCINFO_VERSION(0, 18): 572 581 case SOCINFO_VERSION(0, 17): 573 582 qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant); ··· 604 589 case SOCINFO_VERSION(0, 14): 605 590 qcom_socinfo->info.num_clusters = __le32_to_cpu(info->num_clusters); 606 591 qcom_socinfo->info.ncluster_array_offset = __le32_to_cpu(info->ncluster_array_offset); 607 - qcom_socinfo->info.num_defective_parts = __le32_to_cpu(info->num_defective_parts); 608 - qcom_socinfo->info.ndefective_parts_array_offset = __le32_to_cpu(info->ndefective_parts_array_offset); 592 + qcom_socinfo->info.num_subset_parts = __le32_to_cpu(info->num_subset_parts); 593 + qcom_socinfo->info.nsubset_parts_array_offset = 594 + __le32_to_cpu(info->nsubset_parts_array_offset); 609 595 610 596 debugfs_create_u32("num_clusters", 0444, qcom_socinfo->dbg_root, 611 597 &qcom_socinfo->info.num_clusters); 612 598 debugfs_create_u32("ncluster_array_offset", 0444, qcom_socinfo->dbg_root, 613 599 &qcom_socinfo->info.ncluster_array_offset); 614 - debugfs_create_u32("num_defective_parts", 0444, qcom_socinfo->dbg_root, 615 - &qcom_socinfo->info.num_defective_parts); 616 - debugfs_create_u32("ndefective_parts_array_offset", 0444, qcom_socinfo->dbg_root, 617 - &qcom_socinfo->info.ndefective_parts_array_offset); 600 + debugfs_create_u32("num_subset_parts", 0444, qcom_socinfo->dbg_root, 601 + &qcom_socinfo->info.num_subset_parts); 602 + debugfs_create_u32("nsubset_parts_array_offset", 0444, qcom_socinfo->dbg_root, 603 + &qcom_socinfo->info.nsubset_parts_array_offset); 618 604 fallthrough; 619 605 case SOCINFO_VERSION(0, 13): 620 606 qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id);
+6 -2
include/linux/soc/qcom/socinfo.h
··· 54 54 /* Version 14 */ 55 55 __le32 num_clusters; 56 56 __le32 ncluster_array_offset; 57 - __le32 num_defective_parts; 58 - __le32 ndefective_parts_array_offset; 57 + __le32 num_subset_parts; 58 + __le32 nsubset_parts_array_offset; 59 59 /* Version 15 */ 60 60 __le32 nmodem_supported; 61 61 /* Version 16 */ ··· 68 68 /* Version 18 */ 69 69 __le32 num_kvps; 70 70 __le32 kvps_offset; 71 + /* Version 19 */ 72 + __le32 num_func_clusters; 73 + __le32 boot_cluster; 74 + __le32 boot_core; 71 75 }; 72 76 73 77 #endif