From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Viresh Kumar
<viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Rafael J. Wysocki" <rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>
Cc: Mikko Perttunen <cyndis-/1wQRMveznE@public.gmane.org>,
Sumit Gupta <sumitg-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
catalin.marinas-5wv7dgnIgG8@public.gmane.org,
will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
bbasu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [TEGRA194_CPUFREQ Patch 1/3] firmware: tegra: adding function to get BPMP data
Date: Tue, 7 Apr 2020 12:05:20 +0200 [thread overview]
Message-ID: <20200407100520.GA1720957@ulmo> (raw)
In-Reply-To: <20191204095138.rrul5vxnkprfwmku@vireshk-i7>
[-- Attachment #1: Type: text/plain, Size: 3530 bytes --]
On Wed, Dec 04, 2019 at 03:21:38PM +0530, Viresh Kumar wrote:
> On 04-12-19, 10:33, Thierry Reding wrote:
> > Yeah, the code that registers this device is in drivers/base/cpu.c in
> > register_cpu(). It even retrieves the device tree node for the CPU from
> > device tree and stores it in cpu->dev.of_node, so we should be able to
> > just pass &cpu->dev to tegra_bpmp_get() in order to retrieve a reference
> > to the BPMP.
> >
> > That said, I'm wondering if perhaps we could just add a compatible
> > string to the /cpus node for cases like this where we don't have an
> > actual device representing the CPU complex. There are a number of CPU
> > frequency drivers that register dummy devices just so that they have
> > something to bind a driver to.
> >
> > If we allow the /cpus node to represent the CPU complex (if no other
> > "device" does that yet), we can add a compatible string and have the
> > cpufreq driver match on that.
> >
> > Of course this would be slightly difficult to retrofit into existing
> > drivers because they'd need to remain backwards compatible with existing
> > device trees. But it would allow future drivers to do this a little more
> > elegantly. For some SoCs this may not matter, but especially once you
> > start depending on additional resources this would come in handy.
> >
> > Adding Rob and the device tree mailing list for feedback on this idea.
>
> Took some time to find this thread, but something around this was
> suggested by Rafael earlier.
>
> https://lore.kernel.org/lkml/8139001.Q4eV8YG1Il-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org/
I gave this a try and came up with the following:
--- >8 ---
diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
index f4ede86e32b4..e4462f95f0b3 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -1764,6 +1764,9 @@ bpmp_thermal: thermal {
};
cpus {
+ compatible = "nvidia,tegra194-ccplex";
+ nvidia,bpmp = <&bpmp>;
+
#address-cells = <1>;
#size-cells = <0>;
--- >8 ---
Now I can do something rougly like this, although I have a more complete
patch locally that also gets rid of all the global variables because we
now actually have a struct platform_device that we can anchor everything
at:
--- >8 ---
static const struct of_device_id tegra194_cpufreq_of_match[] = {
{ .compatible = "nvidia,tegra194-ccplex", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, tegra194_cpufreq_of_match);
static struct platform_driver tegra194_ccplex_driver = {
.driver = {
.name = "tegra194-cpufreq",
.of_match_table = tegra194_cpufreq_of_match,
},
.probe = tegra194_cpufreq_probe,
.remove = tegra194_cpufreq_remove,
};
module_platform_driver(tegra194_ccplex_driver);
--- >8 ---
I don't think that's exactly what Rafael (Cc'ed) had in mind, since the
above thread seems to have mostly talked about binding a driver to each
individual CPU.
But this seems a lot better than having to instantiate a device from
scratch just so that a driver can bind to it and it allows additional
properties to be associated with the CCPLEX device.
Rob, any thoughts on this from a device tree point of view? The /cpus
bindings don't mention the compatible property, but there doesn't seem
to be anything in the bindings that would prohibit its use.
If we can agree on that, I can forward my local changes to Sumit for
inclusion or reference.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-04-07 10:05 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-03 17:32 [TEGRA194_CPUFREQ Patch 1/3] firmware: tegra: adding function to get BPMP data Sumit Gupta
2019-12-03 17:32 ` [TEGRA194_CPUFREQ Patch 2/3] cpufreq: Add Tegra194 cpufreq driver Sumit Gupta
2019-12-04 5:40 ` Viresh Kumar
2019-12-04 10:55 ` sumitg
2019-12-04 11:27 ` Viresh Kumar
2019-12-04 13:57 ` Dmitry Osipenko
2019-12-05 2:51 ` Viresh Kumar
2019-12-05 12:55 ` Dmitry Osipenko
2020-03-25 23:59 ` sumitg
2019-12-04 13:59 ` Dmitry Osipenko
2019-12-05 14:15 ` Dmitry Osipenko
[not found] ` <1575394348-17649-2-git-send-email-sumitg-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-03-26 11:50 ` Viresh Kumar
2020-04-04 18:38 ` sumitg
[not found] ` <d233b26b-6b50-7d41-9f33-a5dc151e0e7d-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-04-06 2:55 ` Viresh Kumar
2020-04-07 18:18 ` sumitg
2020-04-08 5:53 ` Viresh Kumar
2020-04-08 11:24 ` sumitg
[not found] ` <08307e54-0e14-14a3-7d6a-d59e1e04a683-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-04-09 7:44 ` Viresh Kumar
2020-04-09 11:21 ` Sumit Gupta
[not found] ` <00390070-38a1-19aa-ca59-42c4658bee7e-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-04-13 6:21 ` Viresh Kumar
2020-04-13 12:20 ` Sumit Gupta
[not found] ` <64b609f1-efb1-425f-a91a-27a492bd3ec4-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-04-14 5:45 ` Viresh Kumar
2020-04-15 11:25 ` Sumit Gupta
[not found] ` <d6e0eed6-4267-fca9-59e1-02d16e17ff34-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2020-04-16 3:37 ` Viresh Kumar
2020-04-16 7:06 ` Sumit Gupta
2019-12-03 17:32 ` [TEGRA194_CPUFREQ Patch 3/3] arm64: defconfig: Enable CONFIG_ARM_TEGRA194_CPUFREQ Sumit Gupta
2019-12-03 17:42 ` [TEGRA194_CPUFREQ Patch 1/3] firmware: tegra: adding function to get BPMP data Thierry Reding
2019-12-04 8:45 ` Mikko Perttunen
2019-12-04 9:17 ` Viresh Kumar
2019-12-04 9:33 ` Thierry Reding
2019-12-04 9:51 ` Viresh Kumar
2020-04-07 10:05 ` Thierry Reding [this message]
2020-04-27 7:18 ` Thierry Reding
2020-04-29 8:21 ` Sumit Gupta
2020-05-06 16:58 ` Thierry Reding
2020-05-20 14:43 ` Rob Herring
[not found] ` <CAL_Jsq+rMYAZ=ub0U7qdHSsWgbQugodhvigFCxrFm49HwrCmAQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-05-20 15:38 ` Thierry Reding
2020-05-20 16:21 ` Rob Herring
2019-12-04 10:21 ` Mikko Perttunen
2019-12-04 10:26 ` Viresh Kumar
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=20200407100520.GA1720957@ulmo \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=bbasu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=cyndis-/1wQRMveznE@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sumitg-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=talho-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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