mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18
@ 2023-06-02  3:25 Naman Jain
  2023-06-02  3:26 ` [PATCH 2/2] soc: qcom: socinfo: Add support for new fields in revision 19 Naman Jain
  2023-06-06 10:33 ` [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Robert Marko
  0 siblings, 2 replies; 4+ messages in thread
From: Naman Jain @ 2023-06-02  3:25 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio
  Cc: Naman Jain, linux-arm-msm, linux-kernel, quic_pkondeti, quic_kaushalk

Add support for below fields coming in socinfo structure under v18:
* num_kvps: number of key value pairs (KVP)
* kvps_offset: the offset of the KVP table from the base address of
  socinfo structure in SMEM
KVP table has boolean values for certain feature flags, used to determine
hardware configuration.

Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
---
 drivers/soc/qcom/socinfo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index c2e4a57dd666..a76006ea8a37 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -181,6 +181,9 @@ struct socinfo {
 	__le32  nnum_partname_mapping;
 	/* Version 17 */
 	__le32 oem_variant;
+	/* Version 18 */
+	__le32 num_kvps;
+	__le32 kvps_offset;
 };
 
 #ifdef CONFIG_DEBUG_FS
@@ -620,6 +623,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
 			   &qcom_socinfo->info.fmt);
 
 	switch (qcom_socinfo->info.fmt) {
+	case SOCINFO_VERSION(0, 18):
 	case SOCINFO_VERSION(0, 17):
 		qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant);
 		debugfs_create_u32("oem_variant", 0444, qcom_socinfo->dbg_root,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] soc: qcom: socinfo: Add support for new fields in revision 19
  2023-06-02  3:25 [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Naman Jain
@ 2023-06-02  3:26 ` Naman Jain
  2023-06-06 10:33 ` [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Robert Marko
  1 sibling, 0 replies; 4+ messages in thread
From: Naman Jain @ 2023-06-02  3:26 UTC (permalink / raw)
  To: Bjorn Andersson, Andy Gross, Konrad Dybcio
  Cc: Naman Jain, linux-arm-msm, linux-kernel, quic_pkondeti, quic_kaushalk

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>
---
 drivers/soc/qcom/socinfo.c | 40 ++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index a76006ea8a37..745afada508b 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -170,8 +170,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 */
@@ -184,6 +184,10 @@ struct socinfo {
 	/* Version 18 */
 	__le32 num_kvps;
 	__le32 kvps_offset;
+	/* Version 19 */
+	__le32 num_func_clusters;
+	__le32 boot_cluster;
+	__le32 boot_core;
 };
 
 #ifdef CONFIG_DEBUG_FS
@@ -201,12 +205,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 {
@@ -623,6 +630,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);
@@ -647,17 +666,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);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18
  2023-06-02  3:25 [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Naman Jain
  2023-06-02  3:26 ` [PATCH 2/2] soc: qcom: socinfo: Add support for new fields in revision 19 Naman Jain
@ 2023-06-06 10:33 ` Robert Marko
  2023-06-06 10:41   ` Naman Jain
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Marko @ 2023-06-06 10:33 UTC (permalink / raw)
  To: Naman Jain, Bjorn Andersson, Andy Gross, Konrad Dybcio
  Cc: linux-arm-msm, linux-kernel, quic_pkondeti, quic_kaushalk


On 02. 06. 2023. 05:25, Naman Jain wrote:
> Add support for below fields coming in socinfo structure under v18:
> * num_kvps: number of key value pairs (KVP)
> * kvps_offset: the offset of the KVP table from the base address of
>    socinfo structure in SMEM
> KVP table has boolean values for certain feature flags, used to determine
> hardware configuration.
>
> Signed-off-by: Naman Jain <quic_namajain@quicinc.com>

Hi,
The socinfo struct itself was moved into a separate header[1] so it can 
be reused,
so this patch series needs to be rebased on top of linux-next.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/soc/qcom/socinfo.h?h=next-20230606&id=ec001bb71e4476f7f5be9db693d5f43e65b9d8cb

Regards,
Robert

> ---
>   drivers/soc/qcom/socinfo.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
> index c2e4a57dd666..a76006ea8a37 100644
> --- a/drivers/soc/qcom/socinfo.c
> +++ b/drivers/soc/qcom/socinfo.c
> @@ -181,6 +181,9 @@ struct socinfo {
>   	__le32  nnum_partname_mapping;
>   	/* Version 17 */
>   	__le32 oem_variant;
> +	/* Version 18 */
> +	__le32 num_kvps;
> +	__le32 kvps_offset;
>   };
>   
>   #ifdef CONFIG_DEBUG_FS
> @@ -620,6 +623,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
>   			   &qcom_socinfo->info.fmt);
>   
>   	switch (qcom_socinfo->info.fmt) {
> +	case SOCINFO_VERSION(0, 18):
>   	case SOCINFO_VERSION(0, 17):
>   		qcom_socinfo->info.oem_variant = __le32_to_cpu(info->oem_variant);
>   		debugfs_create_u32("oem_variant", 0444, qcom_socinfo->dbg_root,
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18
  2023-06-06 10:33 ` [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Robert Marko
@ 2023-06-06 10:41   ` Naman Jain
  0 siblings, 0 replies; 4+ messages in thread
From: Naman Jain @ 2023-06-06 10:41 UTC (permalink / raw)
  To: Robert Marko, Bjorn Andersson, Andy Gross, Konrad Dybcio
  Cc: linux-arm-msm, linux-kernel, quic_pkondeti, quic_kaushalk


On 6/6/2023 4:03 PM, Robert Marko wrote:
>
> On 02. 06. 2023. 05:25, Naman Jain wrote:
>> Add support for below fields coming in socinfo structure under v18:
>> * num_kvps: number of key value pairs (KVP)
>> * kvps_offset: the offset of the KVP table from the base address of
>>    socinfo structure in SMEM
>> KVP table has boolean values for certain feature flags, used to 
>> determine
>> hardware configuration.
>>
>> Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
>
> Hi,
> The socinfo struct itself was moved into a separate header[1] so it 
> can be reused,
> so this patch series needs to be rebased on top of linux-next.
>
> [1] 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/soc/qcom/socinfo.h?h=next-20230606&id=ec001bb71e4476f7f5be9db693d5f43e65b9d8cb
>
> Regards,
> Robert
>
>> ---
>>   drivers/soc/qcom/socinfo.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
>> index c2e4a57dd666..a76006ea8a37 100644
>> --- a/drivers/soc/qcom/socinfo.c
>> +++ b/drivers/soc/qcom/socinfo.c
>> @@ -181,6 +181,9 @@ struct socinfo {
>>       __le32  nnum_partname_mapping;
>>       /* Version 17 */
>>       __le32 oem_variant;
>> +    /* Version 18 */
>> +    __le32 num_kvps;
>> +    __le32 kvps_offset;
>>   };
>>     #ifdef CONFIG_DEBUG_FS
>> @@ -620,6 +623,7 @@ static void socinfo_debugfs_init(struct 
>> qcom_socinfo *qcom_socinfo,
>>                  &qcom_socinfo->info.fmt);
>>         switch (qcom_socinfo->info.fmt) {
>> +    case SOCINFO_VERSION(0, 18):
>>       case SOCINFO_VERSION(0, 17):
>>           qcom_socinfo->info.oem_variant = 
>> __le32_to_cpu(info->oem_variant);
>>           debugfs_create_u32("oem_variant", 0444, 
>> qcom_socinfo->dbg_root,
>>

HI Robert,

Thanks for pointing it out. Will rebase and send it in v2.


Regards,

Naman


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-06 10:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  3:25 [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Naman Jain
2023-06-02  3:26 ` [PATCH 2/2] soc: qcom: socinfo: Add support for new fields in revision 19 Naman Jain
2023-06-06 10:33 ` [PATCH 1/2] soc: qcom: socinfo: Add support for new fields in revision 18 Robert Marko
2023-06-06 10:41   ` Naman Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®