linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, Andy Gross <agross@kernel.org>,
	patches@linaro.org, linaro-kernel@lists.linaro.org
Subject: Re: [PATCH 1/4] soc: qcom: socinfo: add support for newer socinfo data
Date: Thu, 28 May 2020 19:35:43 -0700	[thread overview]
Message-ID: <20200529023543.GQ279327@builder.lan> (raw)
In-Reply-To: <20200525164817.2938638-1-dmitry.baryshkov@linaro.org>

On Mon 25 May 09:48 PDT 2020, Dmitry Baryshkov wrote:

> Add support for newer Qualcomm SoC info structures (up to version 0.15).
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  drivers/soc/qcom/socinfo.c | 55 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
> 
> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
> index ebb49aee179b..0e6adf1161c0 100644
> --- a/drivers/soc/qcom/socinfo.c
> +++ b/drivers/soc/qcom/socinfo.c
> @@ -24,6 +24,7 @@
>  #define SOCINFO_VERSION(maj, min)  ((((maj) & 0xffff) << 16)|((min) & 0xffff))
>  
>  #define SMEM_SOCINFO_BUILD_ID_LENGTH           32
> +#define SMEM_SOCINFO_CHIP_ID_LENGTH            32
>  
>  /*
>   * SMEM item id, used to acquire handles to respective
> @@ -121,6 +122,16 @@ struct socinfo {
>  	__le32 chip_family;
>  	__le32 raw_device_family;
>  	__le32 raw_device_num;
> +	/* Version 13 */
> +	__le32 nproduct_id;
> +	char chip_id[SMEM_SOCINFO_CHIP_ID_LENGTH];
> +	/* Version 14 */
> +	__le32 num_clusters;
> +	__le32 ncluster_array_offset;
> +	__le32 num_defective_parts;
> +	__le32 ndefective_parts_array_offset;
> +	/* Version 15 */
> +	__le32 nmodem_supported;
>  };
>  
>  #ifdef CONFIG_DEBUG_FS
> @@ -135,6 +146,12 @@ struct socinfo_params {
>  	u32 raw_ver;
>  	u32 hw_plat;
>  	u32 fmt;
> +	u32 nproduct_id;
> +	u32 num_clusters;
> +	u32 ncluster_array_offset;
> +	u32 num_defective_parts;
> +	u32 ndefective_parts_array_offset;
> +	u32 nmodem_supported;
>  };
>  
>  struct smem_image_version {
> @@ -268,9 +285,19 @@ static int qcom_show_pmic_die_revision(struct seq_file *seq, void *p)
>  	return 0;
>  }
>  
> +static int qcom_show_chip_id(struct seq_file *seq, void *p)
> +{
> +	struct socinfo *socinfo = seq->private;
> +
> +	seq_printf(seq, "%s\n", socinfo->chip_id);
> +
> +	return 0;
> +}
> +
>  QCOM_OPEN(build_id, qcom_show_build_id);
>  QCOM_OPEN(pmic_model, qcom_show_pmic_model);
>  QCOM_OPEN(pmic_die_rev, qcom_show_pmic_die_revision);
> +QCOM_OPEN(chip_id, qcom_show_chip_id);
>  
>  #define DEFINE_IMAGE_OPS(type)					\
>  static int show_image_##type(struct seq_file *seq, void *p)		  \
> @@ -309,6 +336,34 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,
>  	qcom_socinfo->info.fmt = __le32_to_cpu(info->fmt);
>  
>  	switch (qcom_socinfo->info.fmt) {
> +	case SOCINFO_VERSION(0, 15):
> +		qcom_socinfo->info.nmodem_supported = __le32_to_cpu(info->nmodem_supported);
> +
> +		debugfs_create_u32("nmodem_supported", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.nmodem_supported);
> +		/* Fall through */
> +	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);
> +
> +		debugfs_create_u32("num_clusters", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.num_clusters);
> +		debugfs_create_u32("ncluster_array_offset", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.ncluster_array_offset);
> +		debugfs_create_u32("num_defective_parts", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.num_defective_parts);
> +		debugfs_create_u32("ndefective_parts_array_offset", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.ndefective_parts_array_offset);
> +		/* Fall through */
> +	case SOCINFO_VERSION(0, 13):
> +		qcom_socinfo->info.nproduct_id = __le32_to_cpu(info->nproduct_id);
> +
> +		debugfs_create_u32("nproduct_id", 0400, qcom_socinfo->dbg_root,
> +				   &qcom_socinfo->info.nproduct_id);
> +		DEBUGFS_ADD(info, chip_id);
> +		/* Fall through */
>  	case SOCINFO_VERSION(0, 12):
>  		qcom_socinfo->info.chip_family =
>  			__le32_to_cpu(info->chip_family);
> -- 
> 2.26.2
> 

  parent reply	other threads:[~2020-05-29  2:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 16:48 [PATCH 1/4] soc: qcom: socinfo: add support for newer socinfo data Dmitry Baryshkov
2020-05-25 16:48 ` [PATCH 2/4] soc: qcom: socinfo: fix printing of pmic_model Dmitry Baryshkov
2020-05-29  2:37   ` Bjorn Andersson
2020-05-25 16:48 ` [PATCH 3/4] soc: qcom: socinfo: add file with SoC info format version Dmitry Baryshkov
2020-05-29  2:37   ` Bjorn Andersson
2020-05-25 16:48 ` [PATCH 4/4] soc: qcom: socinfo: add SM8250 entry to soc_id array Dmitry Baryshkov
2020-05-29  2:38   ` Bjorn Andersson
2020-05-29  2:35 ` Bjorn Andersson [this message]
2020-06-22  8:38   ` [PATCH 1/4] soc: qcom: socinfo: add support for newer socinfo data Dmitry Baryshkov
2020-06-23 19:45     ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529023543.GQ279327@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=agross@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=patches@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).