From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Luca Weiss <luca@z3ntu.xyz>,
~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Brian Masney <masneyb@onstation.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] soc: qcom: ocmem: Add OCMEM hardware version print
Date: Mon, 29 May 2023 11:28:57 +0200 [thread overview]
Message-ID: <dd2f0360-bcc0-61a6-09ec-316d8fc51da2@linaro.org> (raw)
In-Reply-To: <20230509-ocmem-hwver-v3-1-e51f3488e0f4@z3ntu.xyz>
On 29.05.2023 10:41, Luca Weiss wrote:
> It might be useful to know what hardware version of the OCMEM block the
> SoC contains. Add a debug print for that.
>
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
> ---
> This patch is depends on [0] but could also be applied in the other
> order, if conflicts are resolved.
>
> [0] https://lore.kernel.org/linux-arm-msm/20230506-msm8226-ocmem-v1-1-3e24e2724f01@z3ntu.xyz/
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
> Changes in v3:
> - Use %lu instead of %ld for print (Konrad)
> - Re-wrap lines so reading is easier (Konrad)
> - Link to v2: https://lore.kernel.org/r/20230509-ocmem-hwver-v2-1-8c8793a07dfc@z3ntu.xyz
>
> Changes in v2:
> - Use FIELD_GET macros for getting correct bits from register (take
> wording from mdp5: major, minor, step which hopefully is sort of
> accurate)
> - Link to v1: https://lore.kernel.org/r/20230509-ocmem-hwver-v1-1-b83ece3f2168@z3ntu.xyz
> ---
> drivers/soc/qcom/ocmem.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/soc/qcom/ocmem.c b/drivers/soc/qcom/ocmem.c
> index c3e78411c637..ef7c1748242a 100644
> --- a/drivers/soc/qcom/ocmem.c
> +++ b/drivers/soc/qcom/ocmem.c
> @@ -76,6 +76,10 @@ struct ocmem {
> #define OCMEM_REG_GFX_MPU_START 0x00001004
> #define OCMEM_REG_GFX_MPU_END 0x00001008
>
> +#define OCMEM_HW_VERSION_MAJOR(val) FIELD_GET(GENMASK(31, 28), val)
> +#define OCMEM_HW_VERSION_MINOR(val) FIELD_GET(GENMASK(27, 16), val)
> +#define OCMEM_HW_VERSION_STEP(val) FIELD_GET(GENMASK(15, 0), val)
> +
> #define OCMEM_HW_PROFILE_NUM_PORTS(val) FIELD_GET(0x0000000f, (val))
> #define OCMEM_HW_PROFILE_NUM_MACROS(val) FIELD_GET(0x00003f00, (val))
>
> @@ -355,6 +359,12 @@ static int ocmem_dev_probe(struct platform_device *pdev)
> }
> }
>
> + reg = ocmem_read(ocmem, OCMEM_REG_HW_VERSION);
> + dev_dbg(dev, "OCMEM hardware version: %lu.%lu.%lu\n",
> + OCMEM_HW_VERSION_MAJOR(reg),
> + OCMEM_HW_VERSION_MINOR(reg),
> + OCMEM_HW_VERSION_STEP(reg));
> +
> reg = ocmem_read(ocmem, OCMEM_REG_HW_PROFILE);
> ocmem->num_ports = OCMEM_HW_PROFILE_NUM_PORTS(reg);
> ocmem->num_macros = OCMEM_HW_PROFILE_NUM_MACROS(reg);
>
> ---
> base-commit: 8705151771af822ac794b44504cd72eebc423499
> change-id: 20230509-ocmem-hwver-99bcb33b028b
>
> Best regards,
next prev parent reply other threads:[~2023-05-29 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 8:41 Luca Weiss
2023-05-29 9:28 ` Konrad Dybcio [this message]
2023-05-30 0:16 ` 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=dd2f0360-bcc0-61a6-09ec-316d8fc51da2@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca@z3ntu.xyz \
--cc=masneyb@onstation.org \
--cc=phone-devel@vger.kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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
all inboxes | Powered by JetHome®