public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Conor Dooley <conor.dooley@microchip.com>
To: Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	"Lukasz Majewski" <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	Padmarao Begari <padmarao.begari@microchip.com>,
	<u-boot@lists.denx.de>
Subject: [PATCH v1 0/6] clk: microchip: mpfs: incremental fixes
Date: Tue, 25 Oct 2022 08:58:43 +0100	[thread overview]
Message-ID: <20221025075848.110754-1-conor.dooley@microchip.com> (raw)

Hey All,
When trying to sync the Linux device tree with U-Boot, the clock driver's
expectation that the input clock it gets is the mss pll presented itself
as a problem. The mss pll is not a fixed frequency clock and the Linux
devicetree has the actual off-chip oscillator & the clock driver there
uses that. This had gone un-noticed in the original dt upstreaming to
Linux and I noticed it while upstreaming the clock driver there.

I order to switch the clock driver over to using the real reference, we
first need to switch over from reading a property of what we assume to be
a fixed-frequency clock in the device tree to using clk_get_rate() and
fix the parentage of the "periph" clocks to represent their actual
relationships to their parents rather than using this fixed-frequency
clock in the devicetree to determine their rates.

With that done, we can then introduce a small driver for the msspll
itself, which we will use if the corrected devicetree node for the clock
controller is present.

There are some more fixes required, specifically handling of the mtimer
clock and of the refclk for the rtc which I have not addressed here, but
will deal with in a follow-up series. I've omitted these fixes here to
do just what is needed to unblock the dt sync.

Thanks,
Conor.

Conor Dooley (6):
  dt-bindings: clk: add missing clk ids for microchip mpfs
  clk: microchip: mpfs: convert parent rate acquistion to get_get_rate()
  clk: microchip: mpfs: fix reference clock handling
  clk: microchip: mpfs: fix periph clk parentage
  clk: microchip: mpfs: fix criticality of peripheral clocks
  riscv: dts: fix the mpfs's reference clock frequency

 arch/riscv/dts/microchip-mpfs-icicle-kit.dts  |   4 +
 arch/riscv/dts/microchip-mpfs.dtsi            |  14 +--
 drivers/clk/microchip/Makefile                |   2 +-
 drivers/clk/microchip/mpfs_clk.c              |  37 ++++--
 drivers/clk/microchip/mpfs_clk.h              |  20 +--
 drivers/clk/microchip/mpfs_clk_cfg.c          |   7 +-
 drivers/clk/microchip/mpfs_clk_msspll.c       | 119 ++++++++++++++++++
 drivers/clk/microchip/mpfs_clk_periph.c       |  96 +++++++-------
 .../dt-bindings/clock/microchip-mpfs-clock.h  |   3 +
 9 files changed, 229 insertions(+), 73 deletions(-)
 create mode 100644 drivers/clk/microchip/mpfs_clk_msspll.c

-- 
2.38.0


             reply	other threads:[~2022-10-25  7:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  7:58 Conor Dooley [this message]
2022-10-25  7:58 ` [PATCH v1 1/6] dt-bindings: clk: add missing clk ids for microchip mpfs Conor Dooley
2022-11-02 11:19   ` Leo Liang
2022-11-02 13:20   ` Padmarao.Begari
2022-10-25  7:58 ` [PATCH v1 2/6] clk: microchip: mpfs: convert parent rate acquistion to get_get_rate() Conor Dooley
2022-11-02 11:20   ` Leo Liang
2022-11-02 13:20   ` Padmarao.Begari
2022-11-02 16:41     ` Conor Dooley
2022-10-25  7:58 ` [PATCH v1 3/6] clk: microchip: mpfs: fix reference clock handling Conor Dooley
2022-11-02 11:21   ` Leo Liang
2022-11-02 13:20   ` Padmarao.Begari
2022-10-25  7:58 ` [PATCH v1 4/6] clk: microchip: mpfs: fix periph clk parentage Conor Dooley
2022-11-02 11:21   ` Leo Liang
2022-11-02 13:20   ` Padmarao.Begari
2022-10-25  7:58 ` [PATCH v1 5/6] clk: microchip: mpfs: fix criticality of peripheral clocks Conor Dooley
2022-11-02 11:22   ` Leo Liang
2022-11-02 13:20   ` Padmarao.Begari
2022-10-25  7:58 ` [PATCH v1 6/6] riscv: dts: fix the mpfs's reference clock frequency Conor Dooley
2022-11-02 11:22   ` Leo Liang
2022-11-02 13:21   ` Padmarao.Begari

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=20221025075848.110754-1-conor.dooley@microchip.com \
    --to=conor.dooley@microchip.com \
    --cc=lukma@denx.de \
    --cc=padmarao.begari@microchip.com \
    --cc=rick@andestech.com \
    --cc=seanga2@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=ycliang@andestech.com \
    /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