From: Christian Marangi <ansuelsmth@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Lorenzo Bianconi <lorenzo@kernel.org>,
upstream@airoha.com
Subject: Re: [PATCH v2] cpufreq: airoha: Add EN7581 Cpufreq SMC driver
Date: Tue, 19 Nov 2024 10:04:27 +0100 [thread overview]
Message-ID: <673c549c.5d0a0220.3a3476.517a@mx.google.com> (raw)
In-Reply-To: <20241119072054.64hi347qmv7ng3un@vireshk-i7>
On Tue, Nov 19, 2024 at 12:50:54PM +0530, Viresh Kumar wrote:
> On 17-10-24, 21:07, Christian Marangi wrote:
> > Add simple Cpufreq driver for Airoha EN7581 SoC that control CPU
> > frequency scaling with SMC APIs.
> >
> > All CPU share the same frequency and can't be controlled independently.
> > Current shared CPU frequency is returned by the related SMC command.
> >
> > Add SoC compatible to cpufreq-dt-plat block list as a dedicated cpufreq
> > driver is needed with OPP v2 nodes declared in DTS.
> >
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> > Changes v2:
> > - Fix kernel bot error with missing slab.h and bitfield.h header
> > - Limit COMPILE_TEST to ARM64 due to smcc 1.2
>
> Hi,
>
> Sorry for delay at my side to review this driver.
>
> Now that I looked at it, I don't see a lot of special stuff happening in the
> driver. There are many other platforms with similar situation. What we have done
> for all them, which rely on OPPs coming from DT, is to add a clk for the CPUs
> and do all this magically smcc stuff from clk_get_rate() and clk_set_rate().
> Once that is done, you should be able to reuse the cpufreq-dt driver as is.
>
> So a CPU clk is the only missing thing in your case I guess.
>
Hi Viresh,
thanks a lot for the follow-up. I will see what I can do, 2 main problem
I see is that, contrary to other driver, for this Airoha SoC, there are
no parents or no clock to enable... It's really just entirely handled by
ATF and smccc call.
And also the SMCCC requires an index and not the clock itself. This was
handy for a cpufreq driver as it passed the OPP index, problematic for a
clock driver as set_rate pass the clock. So I guess I will have to
define the OPP phandle also in the clock node struct. (and map it?)
The main problem in doing that is the performance hit on having to cycle
every time the OPPs to find the correct index...
(yes they really implemented this thing with the ATF specifically with
the cpufreq scenario in mind)
Wonder if you have any hint on any of this.
--
Ansuel
next prev parent reply other threads:[~2024-11-19 9:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-17 19:07 [PATCH v2] cpufreq: airoha: Add EN7581 Cpufreq SMC driver Christian Marangi
2024-11-13 15:55 ` Christian Marangi
2024-11-19 7:20 ` Viresh Kumar
2024-11-19 9:04 ` Christian Marangi [this message]
2024-11-19 10:44 ` Viresh Kumar
2024-11-25 12:43 ` Christian Marangi
2024-11-29 4:02 ` Viresh Kumar
2024-12-02 15:18 ` Christian Marangi
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=673c549c.5d0a0220.3a3476.517a@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=rafael@kernel.org \
--cc=upstream@airoha.com \
--cc=viresh.kumar@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 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.