From: Bjorn Andersson <andersson@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mukesh Ojha <quic_mojha@quicinc.com>,
agross@kernel.org, konrad.dybcio@linaro.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH v3 1/5] firmware: qcom_scm: provide a read-modify-write function
Date: Sun, 19 Mar 2023 20:22:38 -0700 [thread overview]
Message-ID: <20230320032238.xf5jlt43qebcewm4@ripper> (raw)
In-Reply-To: <CACRpkdb95V5GC81w8fiuLfx_V1DtWYpO33FOfMnArpJeC9SDQA@mail.gmail.com>
On Fri, Mar 17, 2023 at 09:56:59PM +0100, Linus Walleij wrote:
> On Fri, Mar 17, 2023 at 5:28 PM Mukesh Ojha <quic_mojha@quicinc.com> wrote:
>
> > It was released by Srinivas K. that there is a need of
> > read-modify-write scm exported function so that it can
> > be used by multiple clients.
> >
> > Let's introduce qcom_scm_io_update_field() which masks
> > out the bits and write the passed value to that
> > bit-offset. Subsequent patch will use this function.
> >
> > Suggested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> > Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
>
> This is starting to reimplement regmap.
> In this case regmap_update_bits().
>
> What about just using regmap as accessor for these
> registers instead?
>
I'm not sure it would be beneficial...
The regmap interface provides a standardized representation of a block
of registers, with the suitable accessors backing it. But in both cases
touched upon in this series, the addressed registers are part of regions
already handled by the kernel.
So it wouldn't be suitable to create a regmap-abstraction for "a block
of secure registers", at best that would give us two kinds of regmaps
abstracting the same register block.
Instead I believe we'd need to extend the struct regmap_config to
introduce a new table telling a new secure-or-unsecure-mmio-regmap which
accessor (secure or unsecure read/write) shoudl be used, and then have
e.g. pinctrl-msm register such regmap, passing the information about
which registers in its memory region is secure.
We'd still need qcom_scm_io_readl() and qcom_scm_io_writel() exported to
implement the new custom regmap implementation - and the struct
regmap_config needed in just pinctrl-msm alone would be larger than the
one function it replaces.
But please let me know if I'm missing something?
Regards,
Bjorn
next prev parent reply other threads:[~2023-03-20 3:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 16:27 [PATCH v3 0/5] Refactor to support multiple download mode Mukesh Ojha
2023-03-17 16:27 ` [PATCH v3 1/5] firmware: qcom_scm: provide a read-modify-write function Mukesh Ojha
2023-03-17 16:52 ` Mukesh Ojha
2023-03-17 20:56 ` Linus Walleij
2023-03-20 3:22 ` Bjorn Andersson [this message]
2023-03-20 8:54 ` Linus Walleij
2023-03-20 17:35 ` Srinivas Kandagatla
2023-03-17 16:27 ` [PATCH v3 2/5] pinctrl: qcom: Use qcom_scm_io_update_field() Mukesh Ojha
2023-03-17 20:58 ` Linus Walleij
2023-03-20 4:10 ` Bjorn Andersson
2023-03-20 8:59 ` Linus Walleij
2023-03-17 16:28 ` [PATCH v3 3/5] firmware: scm: Modify only the download bits in TCSR register Mukesh Ojha
2023-03-17 16:28 ` [PATCH v3 4/5] firmware: qcom_scm: Refactor code to support multiple download mode Mukesh Ojha
2023-03-17 16:28 ` [PATCH v3 5/5] firmware: qcom_scm: Add multiple download mode support Mukesh Ojha
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=20230320032238.xf5jlt43qebcewm4@ripper \
--to=andersson@kernel.org \
--cc=agross@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_mojha@quicinc.com \
/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