From: Eric Biggers <ebiggers@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Abel Vesa <abel.vesa@linaro.org>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Manivannan Sadhasivam <mani@kernel.org>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-mmc@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [RFC PATCH 1/5] soc: qcom: Make the Qualcomm UFS/SDCC ICE a dedicated driver
Date: Wed, 15 Feb 2023 23:42:50 -0800 [thread overview]
Message-ID: <Y+3eenOERCVGW+go@sol.localdomain> (raw)
In-Reply-To: <7442b4f8-0560-35ea-4b0e-1f249fc5c902@linaro.org>
On Tue, Feb 14, 2023 at 02:34:47PM +0100, Konrad Dybcio wrote:
> > +#define QCOM_ICE_BIST_STATUS_MASK 0xF0000000
> GENMASK(31, 28)?
I personally think the plain number is much easier to read...
> btw, most of these defines seem unused?
Yes, the unused definitions can be dropped if people prefer. I only included
them in the original version because this hardware has no public documentation,
so maybe it's helpful to see what registers and fields are available.
I suppose that downstream code could always be dug up if needed, though. Or
maybe someday there will actually be documentation?
> > +static struct qcom_ice *engine;
> > +
> > +static bool qcom_ice_check_supported(struct qcom_ice *ice)
> > +{
> > + u32 regval = qcom_ice_readl(ice, QCOM_ICE_REG_VERSION);
> > + struct device *dev = ice->dev;
> > + int major = regval >> 24;
> > + int minor = (regval >> 16) & 0xFF;
> > + int step = regval & 0xFFFF;
> FIELD_GET?
Similarly, plain bit operations are much more universally understood...
> > + regval = qcom_ice_readl(ice, QCOM_ICE_REG_ADVANCED_CONTROL);
> > + /*
> > + * Enable low power mode sequence
> > + * [0]-0, [1]-0, [2]-0, [3]-E, [4]-0, [5]-0, [6]-0, [7]-0
> Pardon my ignorance, but I have no idea how this comment corresponds
> to the value OR'd..
>
> > + */
> > + regval |= 0x7000;
> > + qcom_ice_writel(ice, regval, QCOM_ICE_REG_ADVANCED_CONTROL);
I'm not sure either! I've never had access to any documentation for this
hardware, so the above logic is just taken from downstream code. I kept that
comment because it was the only available explanation for the value OR'd.
Since it doesn't seem to be useful, I'm fine with just removing it. (But please
keep the "Enable low power mode sequence" part, as that's useful.)
My guess is that it is actually just describing the bits backwards, so [3]-E
corresponds to the three bits that are set.
> > +static void qcom_ice_optimization_enable(struct qcom_ice *ice)
> > +{
> > + u32 regval;
> > +
> > + if (!ice)
> > + return;
> > +
> > + /* ICE Optimizations Enable Sequence */
> > + regval = qcom_ice_readl(ice, QCOM_ICE_REG_ADVANCED_CONTROL);
> > + regval |= 0xD807100;
> Please use lowercase hex, or de-magic-ify this if you have the means to.
I don't know what the 0xD807100 value means, sorry :-( This is just the value
that works to enable the "optimizations", and which the downstream code was
using. If anyone has access to the ICE hardware documentation (if there even
*is* documentation), they might be able to say.
- Eric
next prev parent reply other threads:[~2023-02-16 7:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 12:02 [RFC PATCH 0/5] Add dedicated Qcom ICE driver Abel Vesa
2023-02-14 12:02 ` [RFC PATCH 1/5] soc: qcom: Make the Qualcomm UFS/SDCC ICE a dedicated driver Abel Vesa
2023-02-14 12:46 ` Krzysztof Kozlowski
2023-02-14 13:34 ` Konrad Dybcio
2023-02-16 7:42 ` Eric Biggers [this message]
2023-02-16 7:22 ` Eric Biggers
2023-03-08 21:54 ` Abel Vesa
2023-03-08 23:17 ` Eric Biggers
2023-02-14 12:02 ` [RFC PATCH 2/5] arm64: dts: qcom: sm8450: Add the Inline Crypto Engine node Abel Vesa
2023-02-14 12:47 ` Konrad Dybcio
2023-02-14 12:02 ` [RFC PATCH 3/5] arm64: dts: qcom: sdm630: " Abel Vesa
2023-02-14 12:02 ` [RFC PATCH 4/5] scsi: ufs: ufs-qcom: Switch to the new ICE API Abel Vesa
2023-02-14 12:02 ` [RFC PATCH 5/5] mmc: sdhci-msm: " Abel Vesa
2023-03-02 9:56 ` Adrian Hunter
2023-02-14 12:06 ` [RFC PATCH 0/5] Add dedicated Qcom ICE driver Abel Vesa
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=Y+3eenOERCVGW+go@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=abel.vesa@linaro.org \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@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