[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240503-mbly-olb-v2-0-95ce5a1e18fe@bootlin.com>
Date: Fri, 03 May 2024 16:20:45 +0200
From: Théo Lebrun <theo.lebrun@...tlin.com>
To: Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>,
Linus Walleij <linus.walleij@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>, Lee Jones <lee@...nel.org>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-mips@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
linux-gpio@...r.kernel.org,
Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>,
Gregory CLEMENT <gregory.clement@...tlin.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Tawfik Bayouk <tawfik.bayouk@...ileye.com>,
Théo Lebrun <theo.lebrun@...tlin.com>
Subject: [PATCH v2 00/11] Add Mobileye EyeQ system controller support (clk,
reset, pinctrl)
Hello,
This builds on previous EyeQ5 system-controller revisions[0], 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 (rest will use generic 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
compatibles.
This revision differs from previous in that it exposes all devices as a
single DT node. Driver-wise, a MFD registers multiple cells for each
device. Each driver is still in isolation from one another, each in
their respective subsystem.
This has been requested during previous reviews and took time to
implement; I'd be happy to get some feedback on this aspect.
Patches are targeting MIPS, clk, reset, pinctrl and MFD:
MIPS:
- dt-bindings: clock: mobileye,eyeq5-clk: drop bindings
- dt-bindings: clock: mobileye,eyeq5-reset: drop bindings
- dt-bindings: soc: mobileye: add EyeQ OLB system controller
- MIPS: mobileye: eyeq5: add OLB system-controller node
Start by dropping already accepted dt-bindings that don't match
current approach of single node for entire OLB (and no subnodes).
Then add single dt-bindings that cover clk/reset/pinctrl features.
Squash devicetree commits together into one.
Adapted to having a single devicetree node without subnodes.
MFD:
- driver core: platform: Introduce platform_device_add_with_name()
- mfd: Add cell device name
- mfd: olb: Add support for Mobileye OLB system-controller
There are seven instances of OLB on EyeQ6H. That means many clk/reset
instances. Without naming devices properly it becomes a mess because
integer IDs are not explicit. Add feature to name MFD sub-devices.
Then add OLB MFD platform driver; a really simple driver. Most its
content is iomem resources and MFD cells.
clk:
- clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag
- clk: eyeq: add driver
reset:
- reset: eyeq: add platform driver
pinctrl:
- pinctrl: eyeq5: add platform driver
Have a nice day,
Théo
[0]: https://lore.kernel.org/lkml/20240301-mbly-clk-v9-0-cbf06eb88708@bootlin.com/
Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.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 (11):
dt-bindings: clock: mobileye,eyeq5-clk: drop bindings
dt-bindings: clock: mobileye,eyeq5-reset: drop bindings
dt-bindings: soc: mobileye: add EyeQ OLB system controller
driver core: platform: Introduce platform_device_add_with_name()
mfd: Add cell device name
mfd: olb: Add support for Mobileye 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 --
.../bindings/soc/mobileye/mobileye,eyeq5-olb.yaml | 375 +++++++++++
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/base/platform.c | 17 +-
drivers/clk/Kconfig | 11 +
drivers/clk/Makefile | 1 +
drivers/clk/clk-divider.c | 12 +-
drivers/clk/clk-eyeq.c | 690 +++++++++++++++++++++
drivers/mfd/Kconfig | 10 +
drivers/mfd/Makefile | 2 +
drivers/mfd/mfd-core.c | 2 +-
drivers/mfd/mobileye-olb.c | 180 ++++++
drivers/pinctrl/Kconfig | 14 +
drivers/pinctrl/Makefile | 1 +
drivers/pinctrl/pinctrl-eyeq5.c | 573 +++++++++++++++++
drivers/reset/Kconfig | 13 +
drivers/reset/Makefile | 1 +
drivers/reset/reset-eyeq.c | 541 ++++++++++++++++
include/dt-bindings/clock/mobileye,eyeq5-clk.h | 21 +
include/linux/clk-provider.h | 11 +-
include/linux/mfd/core.h | 19 +-
include/linux/platform_device.h | 12 +-
26 files changed, 2651 insertions(+), 155 deletions(-)
---
base-commit: d5a00175dce1740a3e9d519933ba76f9ce5cbd24
change-id: 20240408-mbly-olb-75a85f5cfde3
Best regards,
--
Théo Lebrun <theo.lebrun@...tlin.com>
Powered by blists - more mailing lists