All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: socinfo: Add support for new fields in revision 16
@ 2022-11-25 10:35 Naman Jain
  2022-12-29 17:49 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Naman Jain @ 2022-11-25 10:35 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio
  Cc: Naman Jain, linux-arm-msm, linux-kernel, quic_pkondeti,
	quic_mojha, quic_shashim

Add support for new fields coming with socinfo structure under v16 to get
SKU information, product code and name and type of different parts present
in the SoC. Also, add debugfs nodes to read feature and product codes to
allow user to get SKU and other SoC details. Support for SoC parts name
and type parsing will be added separately. Details of fields added:
* feature_code: mapped to qcom internal and external SKU IDs
* pcode: product code
* npartnamemap_offset: parts name map array offset from socinfo base ptr
* nnum_partname_mapping: number of part mappings

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

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index 545934aead43..0464e79a3c91 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -169,6 +169,11 @@ struct socinfo {
 	__le32 ndefective_parts_array_offset;
 	/* Version 15 */
 	__le32 nmodem_supported;
+	/* Version 16 */
+	__le32  feature_code;
+	__le32  pcode;
+	__le32  npartnamemap_offset;
+	__le32  nnum_partname_mapping;
 };
 
 #ifdef CONFIG_DEBUG_FS
@@ -189,6 +194,8 @@ struct socinfo_params {
 	u32 num_defective_parts;
 	u32 ndefective_parts_array_offset;
 	u32 nmodem_supported;
+	u32 feature_code;
+	u32 pcode;
 };
 
 struct smem_image_version {
@@ -503,6 +510,15 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
 			   &qcom_socinfo->info.fmt);
 
 	switch (qcom_socinfo->info.fmt) {
+	case SOCINFO_VERSION(0, 16):
+		qcom_socinfo->info.feature_code = __le32_to_cpu(info->feature_code);
+		qcom_socinfo->info.pcode = __le32_to_cpu(info->pcode);
+
+		debugfs_create_u32("feature_code", 0444, qcom_socinfo->dbg_root,
+				   &qcom_socinfo->info.feature_code);
+		debugfs_create_u32("pcode", 0444, qcom_socinfo->dbg_root,
+				   &qcom_socinfo->info.pcode);
+		fallthrough;
 	case SOCINFO_VERSION(0, 15):
 		qcom_socinfo->info.nmodem_supported = __le32_to_cpu(info->nmodem_supported);
 
-- 
2.17.1


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

* Re: [PATCH] soc: qcom: socinfo: Add support for new fields in revision 16
  2022-11-25 10:35 [PATCH] soc: qcom: socinfo: Add support for new fields in revision 16 Naman Jain
@ 2022-12-29 17:49 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2022-12-29 17:49 UTC (permalink / raw)
  To: agross, quic_namajain, konrad.dybcio
  Cc: quic_mojha, quic_shashim, linux-arm-msm, quic_pkondeti, linux-kernel

On Fri, 25 Nov 2022 16:05:33 +0530, Naman Jain wrote:
> Add support for new fields coming with socinfo structure under v16 to get
> SKU information, product code and name and type of different parts present
> in the SoC. Also, add debugfs nodes to read feature and product codes to
> allow user to get SKU and other SoC details. Support for SoC parts name
> and type parsing will be added separately. Details of fields added:
> * feature_code: mapped to qcom internal and external SKU IDs
> * pcode: product code
> * npartnamemap_offset: parts name map array offset from socinfo base ptr
> * nnum_partname_mapping: number of part mappings
> 
> [...]

Applied, thanks!

[1/1] soc: qcom: socinfo: Add support for new fields in revision 16
      commit: f02a537357a61e7892587c0f3455f8295cc9075c

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2022-12-29 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 10:35 [PATCH] soc: qcom: socinfo: Add support for new fields in revision 16 Naman Jain
2022-12-29 17:49 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.