lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqKHPdmafDvKCHZTNNzRAzq2Y34b2dqUXQD6WpE7z2k-jA@mail.gmail.com>
Date: Wed, 24 Jan 2024 13:22:01 -0600
From: Rob Herring <robh@...nel.org>
To: Théo Lebrun <theo.lebrun@...tlin.com>
Cc: Gregory CLEMENT <gregory.clement@...tlin.com>, 
	Michael Turquette <mturquette@...libre.com>, Stephen Boyd <sboyd@...nel.org>, 
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>, 
	Thomas Bogendoerfer <tsbogend@...ha.franken.de>, Linus Walleij <linus.walleij@...aro.org>, 
	Rafał Miłecki <rafal@...ecki.pl>, 
	Philipp Zabel <p.zabel@...gutronix.de>, 
	Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>, linux-mips@...r.kernel.org, 
	linux-clk@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Thomas Petazzoni <thomas.petazzoni@...tlin.com>, 
	Tawfik Bayouk <tawfik.bayouk@...ileye.com>, linux-gpio@...r.kernel.org
Subject: Re: [PATCH v3 04/17] dt-bindings: soc: mobileye: add EyeQ5 OLB system controller

On Wed, Jan 24, 2024 at 11:40 AM Théo Lebrun <theo.lebrun@...tlin.com> wrote:
>
> Hello,
>
> On Wed Jan 24, 2024 at 6:28 PM CET, Théo Lebrun wrote:
> > Hello,
> >
> > On Wed Jan 24, 2024 at 4:14 PM CET, Rob Herring wrote:
> > > On Tue, Jan 23, 2024 at 07:46:49PM +0100, Théo Lebrun wrote:
> > > > Add documentation to describe the "Other Logic Block" syscon.
> > > >
> > > > Signed-off-by: Théo Lebrun <theo.lebrun@...tlin.com>
> > > > ---
> > > >  .../bindings/soc/mobileye/mobileye,eyeq5-olb.yaml  | 77 ++++++++++++++++++++++
> > > >  MAINTAINERS                                        |  1 +
> > > >  2 files changed, 78 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml
> > > > new file mode 100644
> > > > index 000000000000..031ef6a532c1
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml
> > > > @@ -0,0 +1,77 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/soc/mobileye/mobileye,eyeq5-olbyaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Mobileye EyeQ5 SoC system controller
> > > > +
> > > > +maintainers:
> > > > +  - Grégory Clement <gregory.clement@...tlin.com>
> > > > +  - Théo Lebrun <theo.lebrun@...tlin.com>
> > > > +  - Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>
> > > > +
> > > > +description:
> > > > +  OLB ("Other Logic Block") is a hardware block grouping smaller blocks. Clocks,
> > > > +  resets, pinctrl are being handled from here.
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    items:
> > > > +      - const: mobileye,eyeq5-olb
> > > > +      - const: syscon
> > > > +      - const: simple-mfd
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +  clock-controller:
> > > > +    $ref: /schemas/clock/mobileye,eyeq5-clk.yaml#
> > > > +    type: object
> > > > +
> > > > +  reset-controller:
> > > > +    $ref: /schemas/reset/mobileye,eyeq5-reset.yaml#
> > > > +    type: object
> > > > +
> > > > +  pinctrl-a:
> > > > +    $ref: /schemas/pinctrl/mobileye,eyeq5-pinctrl.yaml#
> > > > +    type: object
> > > > +
> > > > +  pinctrl-b:
> > > > +    $ref: /schemas/pinctrl/mobileye,eyeq5-pinctrl.yaml#
> > > > +    type: object
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > > > +
> > > > +additionalProperties: false
> > > > +
> > > > +examples:
> > > > +  - |
> > > > +    system-controller@...000 {
> > > > +      compatible = "mobileye,eyeq5-olb", "syscon", "simple-mfd";
> > > > +      reg = <0xe00000 0x400>;
> > > > +
> > > > +      clock-controller {
> > > > +        compatible = "mobileye,eyeq5-clk";
> > > > +        #clock-cells = <1>;
> > > > +        clocks = <&xtal>;
> > > > +        clock-names = "ref";
> > > > +      };
> > > > +
> > > > +      reset-controller {
> > > > +        compatible = "mobileye,eyeq5-reset";
> > > > +        #reset-cells = <2>;
> > > > +      };
> > > > +
> > > > +      pinctrl-a {
> > > > +        compatible = "mobileye,eyeq5-a-pinctrl";
> > > > +        #pinctrl-cells = <1>;
> > >
> > > Sure you need this? Generally only pinctrl-single uses this.
> >
> > You are completely right, it is useless. I naively expected it in the
> > same vein as other subsystems.
> >
> > >
> > > > +      };
> > > > +
> > > > +      pinctrl-b {
> > > > +        compatible = "mobileye,eyeq5-b-pinctrl";
> > > > +        #pinctrl-cells = <1>;
> > > > +      };
> > > > +    };
> > >
> > > This can all be simplified to:
> > >
> > > system-controller@...000 {
> > >     compatible = "mobileye,eyeq5-olb", "syscon";
> > >     reg = <0xe00000 0x400>;
> > >     #reset-cells = <2>;
> > >     #clock-cells = <1>;
> > >     clocks = <&xtal>;
> > >     clock-names = "ref";
> > >
> > >     pins { ... };
> > > };
> > >
> > > There is no need for sub nodes unless you have reusable blocks or each
> > > block has its own resources in DT.
> >
> > That is right, and it does simplify the devicetree as you have shown.
> > However, the split nodes gives the following advantages:
> >
> >  - Devicetree-wise, it allows for one alias per function.
> >    `clocks = <&clocks EQ5C_PLL_CPU>` is surely more intuitive
> >    than `clocks = <&olb EQ5C_PLL_CPU>;`. Same for reset.

clocks: resets: pinctrl: system-controller@...000 {

> >
> >  - It means an MFD driver must be implemented, adding between 100 to 200
> >    lines of boilerplate code to the kernel.

>From a binding perspective, not my problem... That's Linux details
defining the binding. What about u-boot, BSD, future versions of Linux
with different structure?

I don't think an MFD is required here. A driver should be able to be
both clock and reset provider. That's pretty common. pinctrl less so.

> >  - It means one pinctrl device for the two banks. That addresses your
> >    comment on [PATCH v3 10/17]. This is often done and would be doable
> >    on this platform. However it means added logic to each individual
> >    function of pinctrl-eyeq5.

If it makes things easier, 2 'pins' sub-nodes is fine. That's just
container nodes.

> >    Overall it makes for less readable code, for code that already looks
> >    more complex than it really is.
> >
> >    My initial non-public version of pinctrl-eyeq5 was using this method
> >    (a device handling both banks) and I've leaned away from it.
>
> I had forgotten one other reason:
>
>  - Reusability does count for something. Other Mobileye platforms exist,
>    and the system controller stuff is more complex on those. Multiple
>    different OLB blocks, etc. But my understanding is that
>    per-peripheral logic is reused across versions.

IME, this stuff never stays exactly the same from chip to chip.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ