linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* opp: How to use multiple opp-supported-hw versions properly?
@ 2020-08-25  7:44 Stephan Gerhold
  2020-08-25  8:16 ` Viresh Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Stephan Gerhold @ 2020-08-25  7:44 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: Nishanth Menon, Stephen Boyd, linux-pm, Dmitry Osipenko

Hi Viresh,

(an unrelated questions while I investigate the device links ;) )

I'm a bit confused about how to use "opp-supported-hw" properly
when you have multiple versions defined.

In my case I have two version numbers from 0-7, so theoretically up to
64 versions. This does not fit into a single version mask so I added
them as separate versions to the OPP table.

Now let's say I want to limit an OPP to v0.1, v1.0 and v1.1, but not
v0.0. With a single "opp-supported-hw" I think I can only say:

	opp-supported-hw = <0x3 0x3>;

but that does also include v0.0...
I think to exclude that I would need multiple version ranges, e.g.

	opp-supported-hw = <0x1 0x2>, <0x2 0x3>;

This does not seem to be supported, though.

I believe a similar situation exists in tegra20-cpu-opp.dtsi:
The way it was solved there is to duplicate many of the OPP nodes
and set them with different "opp-supported-hw" properties. e.g.

	opp@1000000000,1000 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x02 0x0006>; // v1.1 or v1.2
		opp-hz = /bits/ 64 <1000000000>;
	};

	opp@1000000000,1000,0,2 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x01 0x0004>; // v0.2
		opp-hz = /bits/ 64 <1000000000>;
	};

I think this is supposed to say v1.1, v1.2 or v0.2, but not v0.1.

I suppose duplicating the OPP node would also work in my case, but
personally I think this just makes the OPP table unnecessarily hard
to understand - especially when there are many more properties like
interconnects, other required-opps, ...

Wouldn't it be much cleaner to allow setting multiple version ranges
for a single "opp-supported-hw" property? The above could then become:

	opp@1000000000,1000 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x02 0x0006>, <0x01 0x004>; // v1.1, v1.2 or v0.2
		opp-hz = /bits/ 64 <1000000000>;
	};

Or is there some other option that I'm missing?

Thanks!
Stephan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-26 11:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-25  7:44 opp: How to use multiple opp-supported-hw versions properly? Stephan Gerhold
2020-08-25  8:16 ` Viresh Kumar
2020-08-25  8:57   ` Stephan Gerhold
2020-08-25  9:56     ` Viresh Kumar
2020-08-25 10:35       ` Stephan Gerhold
2020-08-26 11:51         ` Viresh Kumar
2020-08-25 10:59   ` Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).