linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Théo Lebrun" <theo.lebrun@bootlin.com>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Lee Jones" <lee@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Rob Herring" <robh@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>
Subject: Re: [PATCH v2 00/11] Add Mobileye EyeQ system controller support (clk, reset, pinctrl)
Date: Tue, 07 May 2024 17:14:25 +0200	[thread overview]
Message-ID: <D13IE06GUEJ9.UUNOU4QH2QN9@bootlin.com> (raw)
In-Reply-To: <D13HXGJGMS76.XIIIZLZBCZ09@bootlin.com>

Hello,

On Tue May 7, 2024 at 4:52 PM CEST, Théo Lebrun wrote:
> On Sat May 4, 2024 at 4:34 AM CEST, Stephen Boyd wrote:
> > Quoting Théo Lebrun (2024-05-03 07:20:45)
> > > 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.
> >
> > Why can't you use auxiliary device and driver APIs?
>
> Good question. Reasons I see:
>
>  - I didn't know about auxdev beforehand. I discussed the rework with a
>    few colleagues and none mentioned it either.
>
>  - It feels simpler to let each device access iomem resources. From my
>    understanding, an auxdev is supposed to make function calls to its
>    parent without inheriting iomem access. That sounds like it will put
>    the register logic/knowledge inside a single driver, which could or
>    could not be a better option.
>
>    Implementing a function like this feels like cheating:
>       int olb_read(struct device *dev, u32 offset, u32 *val);
>
>    With an MFD, we hand over a part of the iomem resource to each child
>    and they deal with it however they like.
>
>  - Syscon is what I picked to share parts of OLB to other devices that
>    need it. Currently that is only for I2C speed mode but other devices
>    have wrapping-related registers. MFD and syscon are deeply connected
>    so an MFD felt natural.
>
>  - That would require picking one device that is platform driver, the
>    rest being all aux devices. Clock driver appears to be the one, same
>    as two existing mpfs and starfive-jh7110 that use auxdev for clk and
>    reset.
>
> Main reason I see for picking auxdev is that it forces devices to
> interact with a defined internal API. That can lead to nicer
> abstractions rather than inheriting resources as is being done in MFD.
>
> Are there other reasons?

Self replying myself. I gave myself some time to think about that but I
still have more thought now that I've written the previous email, and
re-read almost all old revisions of this series.

I do like this auxdev proposal. More so than current MFD revision. One
really nice feature is that it centralises access to iomem. I've
noticed recently a register that has most its fields for reset but one
lost bit dealing with a clock mux. Logic to handle that would be in one
location.

Also, I just noticed you hinted at auxiliary devices in previous emails,
which I thought was a generic term. I did not see it as a specific
kernel infrastructure to be used. Sorry about that.

Regards,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2024-05-07 15:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 14:20 [PATCH v2 00/11] Add Mobileye EyeQ system controller support (clk, reset, pinctrl) Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 01/11] dt-bindings: clock: mobileye,eyeq5-clk: drop bindings Théo Lebrun
2024-05-03 15:57   ` Krzysztof Kozlowski
2024-05-03 16:05     ` Krzysztof Kozlowski
2024-05-07 15:07       ` Théo Lebrun
2024-05-07 15:34         ` Krzysztof Kozlowski
2024-06-20 17:39           ` Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 02/11] dt-bindings: clock: mobileye,eyeq5-reset: " Théo Lebrun
2024-05-03 15:35   ` Rob Herring (Arm)
2024-05-03 14:20 ` [PATCH v2 03/11] dt-bindings: soc: mobileye: add EyeQ OLB system controller Théo Lebrun
2024-05-03 15:35   ` Rob Herring (Arm)
2024-05-07 12:51   ` Rob Herring
2024-06-20 17:41     ` Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 04/11] driver core: platform: Introduce platform_device_add_with_name() Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 05/11] mfd: Add cell device name Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 06/11] mfd: olb: Add support for Mobileye OLB system-controller Théo Lebrun
2024-05-31 11:05   ` Lee Jones
2024-06-20 17:48     ` Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 07/11] clk: divider: Introduce CLK_DIVIDER_EVEN_INTEGERS flag Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 08/11] clk: eyeq: add driver Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 09/11] reset: eyeq: add platform driver Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 10/11] pinctrl: eyeq5: " Théo Lebrun
2024-05-03 14:20 ` [PATCH v2 11/11] MIPS: mobileye: eyeq5: add OLB system-controller node Théo Lebrun
2024-05-04  2:34 ` [PATCH v2 00/11] Add Mobileye EyeQ system controller support (clk, reset, pinctrl) Stephen Boyd
2024-05-07 14:52   ` Théo Lebrun
2024-05-07 15:14     ` Théo Lebrun [this message]
2024-05-07 21:48     ` Stephen Boyd
2024-06-20 18:00       ` 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=D13IE06GUEJ9.UUNOU4QH2QN9@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).