From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Linus Walleij <linus.walleij@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Lee Jones <lee@kernel.org>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-gpio@vger.kernel.org,
"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>
Subject: [PATCH v3 0/9] Add Mobileye EyeQ system controller support (clk, reset, pinctrl)
Date: Thu, 20 Jun 2024 19:30:52 +0200 [thread overview]
Message-ID: <20240620-mbly-olb-v3-0-5f29f8ca289c@bootlin.com> (raw)
Hello,
This builds on previous Mobileye EyeQ system-controller revisions,
supporting EyeQ5, EyeQ6L and EyeQ6H. We expose a few OLB
system-controller features here:
- Clocks: some read-only PLLs derived from main crystal and some
divider clocks based on PLLs.
- Resets.
- Pin controller, only on EyeQ5 (others will use pinctrl-single).
EyeQ6H is special in that it has seven instances of this
system-controller. Those are spread around and cannot be seen as a
single device, hence are exposed as seven DT nodes and seven
unique compatibles.
Following feedback (that took time to reach my brain, sorry about that):
- We expose each system-controller as a single devicetree node. This
means reverting previously accepted dt-bindings that described a
one-node-per-feature approach.
- We use auxiliary devices infrastructure to split functionality into
separate drivers. Clock is the platform driver that spawns child
auxdevs. They get an iomem pointer to the OLB region as
platform_data. They know which behavior to implement by matching
compatible on their parent device's OF node.
Patches are targeting MIPS, clk, reset and pinctrl:
MIPS:
- dt-bindings: soc: mobileye: add EyeQ OLB system controller
- MIPS: mobileye: eyeq5: add OLB system-controller node
clk:
- Revert "dt-bindings: clock: mobileye,eyeq5-clk: add bindings"
- clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag
- clk: eyeq: add driver
reset:
- Revert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings"
- reset: eyeq: add platform driver
pinctrl:
- Revert "dt-bindings: pinctrl: mobileye,eyeq5-pinctrl: add bindings"
- pinctrl: eyeq5: add platform driver
Have a nice day,
Théo
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
Changes in v3:
- Drivers: Switch to using auxiliary devices. Drop the MFD patches.
Consequent changes to the clk driver that now spawns its auxdevs.
Reset and pinctrl switch from being platform driver to auxdevs.
- dt-bindings and EyeQ5 DTS: remove "simple-mfd" compatible from all OLB
nodes.
- dt-bindings: rewrite commit title and messages. Title now takes the
standard revert format.
- dt-bindings: revert pinctrl dt-bindings as well; this was forgotten in
the previous revision.
- clk driver: fix overflow of factors; they get stored in 32-bit ints in
fixed-factor which we overflowed when spread-spectrum is enabled.
- Link to v2: https://lore.kernel.org/r/20240503-mbly-olb-v2-0-95ce5a1e18fe@bootlin.com
Changes in v2:
- dt-bindings:
- Drop mobileye,eyeq5-clk and mobileye,eyeq5-reset bindings.
- Update OLB bindings to handle clk/reset/pinctrl from OLB node.
- MFD:
- Add core driver and MFD patches to allow setting sub-devices names
from MFD cell.
- Add MFD OLB driver.
- clk:
- Change type of eqc_pll->reg64 from u32 to unsigned int.
- Use resource indexes rather than names for iomem resources.
- Put early PLLs into a separate match data table. Also, have store
number of late clocks in early match data to properly alloc cells.
- Pre-acquire all divclk resources first, then register them.
This simplifies code.
- Extract PLLs and divclks init to two separate functions.
- Avoid variable declarations in loop bodies.
- Do not register match data table to platform driver. It gets probed
as MFD sub-device matching on driver name. Match data table is
matched against parent OF node compatible.
- Fix ugly memory corruption bug when clk count == 1.
- reset:
- EQR_EYEQ5_SARCR and EQR_EYEQ6H_SARCR did not use offset 0x0: do
minus four to all their offsets and reduce resource sizes.
- Remove resource names. Reset i uses iomem resource index i.
- Simplify xlate: have two implementations for of_reset_n_cells==1 and
of_reset_n_cells==2. Both call the same helper internal function.
- Do not register match data table to platform driver. It gets probed
as MFD sub-device matching on driver name. Match data table is
matched against parent OF node compatible.
- pinctrl:
- Remove match data table to platform driver. It gets probed as MFD
sub-device matching on driver name. Driver has single compatible.
- Drop "Reviewed-by: Linus Walleij" as driver changed approach.
- MIPS DTS:
- Squash all commits together into a single one.
- Adapt to new approach: OLB is now a single OF node.
- Link to v1: https://lore.kernel.org/r/20240410-mbly-olb-v1-0-335e496d7be3@bootlin.com
---
Théo Lebrun (9):
Revert "dt-bindings: clock: mobileye,eyeq5-clk: add bindings"
Revert "dt-bindings: reset: mobileye,eyeq5-reset: add bindings"
Revert "dt-bindings: pinctrl: mobileye,eyeq5-pinctrl: add bindings"
dt-bindings: soc: mobileye: add EyeQ OLB system controller
clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag
clk: eyeq: add driver
reset: eyeq: add platform driver
pinctrl: eyeq5: add platform driver
MIPS: mobileye: eyeq5: add OLB system-controller node
.../bindings/clock/mobileye,eyeq5-clk.yaml | 51 --
.../bindings/reset/mobileye,eyeq5-reset.yaml | 43 --
.../mobileye/mobileye,eyeq5-olb.yaml} | 168 ++++-
MAINTAINERS | 5 +
.../{eyeq5-fixed-clocks.dtsi => eyeq5-clocks.dtsi} | 54 +-
arch/mips/boot/dts/mobileye/eyeq5-pins.dtsi | 125 ++++
arch/mips/boot/dts/mobileye/eyeq5.dtsi | 22 +-
drivers/clk/Kconfig | 12 +
drivers/clk/Makefile | 1 +
drivers/clk/clk-divider.c | 12 +-
drivers/clk/clk-eyeq.c | 789 +++++++++++++++++++++
drivers/pinctrl/Kconfig | 15 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-eyeq5.c | 576 +++++++++++++++
drivers/reset/Kconfig | 14 +
drivers/reset/Makefile | 1 +
drivers/reset/reset-eyeq.c | 563 +++++++++++++++
include/dt-bindings/clock/mobileye,eyeq5-clk.h | 21 +
include/linux/clk-provider.h | 11 +-
19 files changed, 2326 insertions(+), 158 deletions(-)
---
base-commit: 061f2865f17c038f04a71ccdd6c90746381d63a8
change-id: 20240408-mbly-olb-75a85f5cfde3
Best regards,
--
Théo Lebrun <theo.lebrun@bootlin.com>
next reply other threads:[~2024-06-20 17:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 17:30 Théo Lebrun [this message]
2024-06-20 17:30 ` [PATCH v3 1/9] Revert "dt-bindings: clock: mobileye,eyeq5-clk: add bindings" Théo Lebrun
2024-06-24 20:55 ` Rob Herring (Arm)
2024-06-20 17:30 ` [PATCH v3 2/9] Revert "dt-bindings: reset: mobileye,eyeq5-reset: " Théo Lebrun
2024-06-20 18:26 ` Rob Herring (Arm)
2024-06-24 20:20 ` Rob Herring
2024-06-24 20:56 ` Rob Herring (Arm)
2024-06-20 17:30 ` [PATCH v3 3/9] Revert "dt-bindings: pinctrl: mobileye,eyeq5-pinctrl: " Théo Lebrun
2024-06-24 20:56 ` Rob Herring (Arm)
2024-06-26 11:53 ` Linus Walleij
2024-06-20 17:30 ` [PATCH v3 4/9] dt-bindings: soc: mobileye: add EyeQ OLB system controller Théo Lebrun
2024-06-20 18:26 ` Rob Herring (Arm)
2024-06-24 20:56 ` Rob Herring (Arm)
2024-06-20 17:30 ` [PATCH v3 5/9] clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag Théo Lebrun
2024-06-20 17:30 ` [PATCH v3 6/9] clk: eyeq: add driver Théo Lebrun
2024-06-20 17:30 ` [PATCH v3 7/9] reset: eyeq: add platform driver Théo Lebrun
2024-06-25 9:17 ` Philipp Zabel
2024-06-26 13:55 ` Théo Lebrun
2024-06-26 14:10 ` Philipp Zabel
2024-06-20 17:31 ` [PATCH v3 8/9] pinctrl: eyeq5: " Théo Lebrun
2024-06-20 17:31 ` [PATCH v3 9/9] MIPS: mobileye: eyeq5: add OLB system-controller node Théo Lebrun
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=20240620-mbly-olb-v3-0-5f29f8ca289c@bootlin.com \
--to=theo.lebrun@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=gregory.clement@bootlin.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tsbogend@alpha.franken.de \
--cc=vladimir.kondratiev@mobileye.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;
as well as URLs for NNTP newsgroup(s).