linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cpufreq: Add imx-cpufreq-dt driver
@ 2019-05-02 22:44 Leonard Crestez
  2019-05-02 22:44 ` [PATCH v2 1/3] " Leonard Crestez
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Leonard Crestez @ 2019-05-02 22:44 UTC (permalink / raw)
  To: Viresh Kumar, Lucas Stach, Shawn Guo
  Cc: Aisheng Dong, Jacky Bai, Anson Huang, linux-pm@vger.kernel.org,
	Rafael J. Wysocki, dl-linux-imx, kernel@pengutronix.de,
	Fabio Estevam, linux-arm-kernel@lists.infradead.org, Abel Vesa

Right now in upstream imx8m cpufreq support just lists a common subset
of OPPs because the higher ones should only be attempted after checking
speed grading in fuses.

Add a small driver which checks speed grading from nvmem cells before
registering cpufreq-dt.

---

By default kconfig builds it as a module even though it's very small.
Couldn't find a way for MODULE_DEVICE_TABLE to match on root node compat
string and there was no other appropriate node so register the
imx-cpufreq-dt platfrom device directly from imx8 soc driver instead. I
checked module is probed by default and rmmod/modprobe again works.

It seems that cpufreq-dt insists on adding the opp and regulator itself
so can't actually call dev_pm_opp_of_add_table and then
dev_pm_opp_disable so implementation was switched to opp-supported-hw.
Maybe I'm confused by API quirks?

The market segment logic was dropped because I couldn't find any good
references in datasheets for why lower or intermediary OPPs should be
disabled on certain market segments. Using opp-supported-hw means that
adding this in the future would require changing flags inside DT instead
of code, that seems undesirable for DT compat reasons.

This could also be extended to mach-imx7d speed grading.

I never noticed anything wrong with going above the fused speed grading
however it's technically unsafe so the cpufreq parts should go in before
DT changes.

Other changes since v1:
 * Turn into a proper module
 * Support imx8mq
Link to v1 (RFC): https://patchwork.kernel.org/patch/10916769/

Leonard Crestez (3):
  cpufreq: Add imx-cpufreq-dt driver
  arm64: dts: imx8mm: Add cpu speed grading and all OPPs
  arm64: dts: imx8mq: Add cpu speed grading and all OPPs

 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 23 +++++-
 arch/arm64/boot/dts/freescale/imx8mq.dtsi | 23 +++++-
 drivers/cpufreq/Kconfig.arm               | 10 +++
 drivers/cpufreq/Makefile                  |  1 +
 drivers/cpufreq/cpufreq-dt-platdev.c      |  3 +
 drivers/cpufreq/imx-cpufreq-dt.c          | 99 +++++++++++++++++++++++
 drivers/soc/imx/soc-imx8.c                |  3 +
 7 files changed, 160 insertions(+), 2 deletions(-)
 create mode 100644 drivers/cpufreq/imx-cpufreq-dt.c

-- 
2.17.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-05-07  5:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02 22:44 [PATCH v2 0/3] cpufreq: Add imx-cpufreq-dt driver Leonard Crestez
2019-05-02 22:44 ` [PATCH v2 1/3] " Leonard Crestez
2019-05-03  6:52   ` Viresh Kumar
2019-05-03  9:44     ` Leonard Crestez
2019-05-03  9:53       ` Viresh Kumar
2019-05-02 22:44 ` [PATCH v2 2/3] arm64: dts: imx8mm: Add cpu speed grading and all OPPs Leonard Crestez
2019-05-03  6:52   ` Viresh Kumar
2019-05-02 22:44 ` [PATCH v2 3/3] arm64: dts: imx8mq: " Leonard Crestez
2019-05-03  6:53   ` Viresh Kumar
2019-05-03  6:50 ` [PATCH v2 0/3] cpufreq: Add imx-cpufreq-dt driver Viresh Kumar
2019-05-03 11:51   ` Leonard Crestez
2019-05-07  5:35     ` Viresh Kumar

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).