linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Lucas Stach <l.stach@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>
Cc: Aisheng Dong <aisheng.dong@nxp.com>, Jacky Bai <ping.bai@nxp.com>,
	Anson Huang <anson.huang@nxp.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	dl-linux-imx <linux-imx@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Abel Vesa <abel.vesa@nxp.com>
Subject: [PATCH v2 0/3] cpufreq: Add imx-cpufreq-dt driver
Date: Thu, 2 May 2019 22:44:12 +0000	[thread overview]
Message-ID: <cover.1556836868.git.leonard.crestez@nxp.com> (raw)

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

             reply	other threads:[~2019-05-02 22:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-02 22:44 Leonard Crestez [this message]
2019-05-02 22:44 ` [PATCH v2 1/3] cpufreq: Add imx-cpufreq-dt driver 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

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=cover.1556836868.git.leonard.crestez@nxp.com \
    --to=leonard.crestez@nxp.com \
    --cc=abel.vesa@nxp.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=ping.bai@nxp.com \
    --cc=rjw@rjwysocki.net \
    --cc=shawnguo@kernel.org \
    --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 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).