mbox series

[v2,00/10] Usable clocks on Mobileye EyeQ5 & EyeQ6H

Message ID 20241106-mbly-clk-v2-0-84cfefb3f485@bootlin.com (mailing list archive)
Headers show
Series Usable clocks on Mobileye EyeQ5 & EyeQ6H | expand

Message

Théo Lebrun Nov. 6, 2024, 4:03 p.m. UTC
Now that clk-eyeq is in the clk-next tree, we can add the small(-ish)
details required to make the platform work fully. The work is mostly
about updating devicetrees to rely on the system-controller nodes as
clock providers.

--

Things we do:

 - In EyeQ5 devicetrees, remove all fixed-factor clocks that are derived
   from clk-eyeq PLLs. We expose those directly from clk-eyeq (using
   match data info). This is simpler to reason about.

   [PATCH v2 02/10] dt-bindings: clock: eyeq: add more Mobileye EyeQ5/EyeQ6H clocks
   [PATCH v2 03/10] clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
   [PATCH v2 05/10] clk: eyeq: add fixed factor clocks infrastructure
   [PATCH v2 06/10] clk: eyeq: add EyeQ5 fixed factor clocks
   [PATCH v2 09/10] MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks

 - EyeQ6H devicetrees used fixed-clocks and didn't have
   system-controllers defined. Remove all that and define our syscons.

   [PATCH v2 07/10] clk: eyeq: add EyeQ6H central fixed factor clocks
   [PATCH v2 08/10] clk: eyeq: add EyeQ6H west fixed factor clocks
   [PATCH v2 10/10] MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks

 - Our bindings used to say that some compatibles require a clock cell
   (those that expose multiple clocks) and others do not. Remove that
   subtlety and enforce a clock cell for everyone.

   The goal is to make it easier to add clocks to compatibles that
   previously exposed a single one. It happens for two compatibles in
   this patch series (EyeQ6H central and west).

   This is a "revert". I had been advised in the initial patch that the
   behavior was a bad idea. I 100% agree with those comments.

   [PATCH v2 01/10] dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all compatibles
   [PATCH v2 04/10] clk: eyeq: require clock index with phandle in all cases

--

In which tree patches should go:

 - clk:
   [PATCH v2 02/10] dt-bindings: clock: eyeq: add more Mobileye EyeQ5/EyeQ6H clocks
   [PATCH v2 03/10] clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
   [PATCH v2 04/10] clk: eyeq: require clock index with phandle in all cases
   [PATCH v2 05/10] clk: eyeq: add fixed factor clocks infrastructure
   [PATCH v2 06/10] clk: eyeq: add EyeQ5 fixed factor clocks
   [PATCH v2 07/10] clk: eyeq: add EyeQ6H central fixed factor clocks
   [PATCH v2 08/10] clk: eyeq: add EyeQ6H west fixed factor clocks

 - MIPS:
   [PATCH v2 01/10] dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all compatibles
   [PATCH v2 09/10] MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks
   [PATCH v2 10/10] MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks

Reasoning: we need the clock indexes from dt-bindings headers to avoid
breaking the driver build, so patch 2 must go in clk-next.

Note about devicetree patches 9-10: other patches on the same
devicetrees are in the mailing-lists, with which I expect conflicts.
All should be straight-forward to resolve.

Thanks,
Have a nice day,
Théo

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
Changes in v2:
- Patch "dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all
         compatibles":
  - Mention that we break ABI (#clock-cells) in commit message, and
    explain why. [0]
- Patches "dt-bindings: clock: eyeq: add * clocks":
  - Squash all four patches into a single one. [1]
  - Improve the commit message, describing the clock tree structure.
  - Expose more EyeQ5 peripheral clocks: SPI, I2C, GPIO, EMMC, PCI.
    We already know those will be used later down the road.
- Patch "clk: eyeq: add EyeQ5 fixed factor clocks":
  - Use enum to auto-number non-exposed EyeQ5 clock indexes.
    Start from the last dt-bindings exposed index plus one.
- Link to v1: https://lore.kernel.org/r/20241031-mbly-clk-v1-0-89d8b28e3006@bootlin.com

[0]: https://lore.kernel.org/lkml/20241105133323.GA3064907-robh@kernel.org/
[1]: https://lore.kernel.org/lkml/7ebcdarioght4u2bai4l42pckitcw5iz4rky4ncgp7aqmtrlen@zl7k7pgijloq/

---
Théo Lebrun (10):
      dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all compatibles
      dt-bindings: clock: eyeq: add more Mobileye EyeQ5/EyeQ6H clocks
      clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
      clk: eyeq: require clock index with phandle in all cases
      clk: eyeq: add fixed factor clocks infrastructure
      clk: eyeq: add EyeQ5 fixed factor clocks
      clk: eyeq: add EyeQ6H central fixed factor clocks
      clk: eyeq: add EyeQ6H west fixed factor clocks
      MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks
      MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks

 .../bindings/soc/mobileye/mobileye,eyeq5-olb.yaml  |  24 +-
 arch/mips/boot/dts/mobileye/eyeq5-clocks.dtsi      | 270 ---------------------
 arch/mips/boot/dts/mobileye/eyeq5.dtsi             |  30 ++-
 .../boot/dts/mobileye/eyeq6h-fixed-clocks.dtsi     |  52 ----
 arch/mips/boot/dts/mobileye/eyeq6h.dtsi            |  73 +++++-
 drivers/clk/clk-eyeq.c                             | 208 ++++++++++++++--
 drivers/clk/clk-fixed-factor.c                     |  11 +
 include/dt-bindings/clock/mobileye,eyeq5-clk.h     |  44 +++-
 include/linux/clk-provider.h                       |   3 +
 9 files changed, 327 insertions(+), 388 deletions(-)
---
base-commit: 11713909beb7debd3d466a6dc302a33d91298be0
change-id: 20241030-mbly-clk-a877f3793eb2

Best regards,

Comments

Théo Lebrun Nov. 15, 2024, 9:24 a.m. UTC | #1
Hello Thomas,

On Wed Nov 6, 2024 at 5:03 PM CET, Théo Lebrun wrote:
> Now that clk-eyeq is in the clk-next tree, we can add the small(-ish)
> details required to make the platform work fully. The work is mostly
> about updating devicetrees to rely on the system-controller nodes as
> clock providers.

[...]

>  - clk:
>    [PATCH v2 01/10] dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all compatibles
>    [PATCH v2 02/10] dt-bindings: clock: eyeq: add more Mobileye EyeQ5/EyeQ6H clocks
>    [PATCH v2 03/10] clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
>    [PATCH v2 04/10] clk: eyeq: require clock index with phandle in all cases
>    [PATCH v2 05/10] clk: eyeq: add fixed factor clocks infrastructure
>    [PATCH v2 06/10] clk: eyeq: add EyeQ5 fixed factor clocks
>    [PATCH v2 07/10] clk: eyeq: add EyeQ6H central fixed factor clocks
>    [PATCH v2 08/10] clk: eyeq: add EyeQ6H west fixed factor clocks
>
>  - MIPS:
>    [PATCH v2 09/10] MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks
>    [PATCH v2 10/10] MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks

Do you think we can make those two patches go in before the next merge
window? Stephen just accepted the above patches. This makes both MIPS
platforms usable on upstream kernels!

Thanks,

--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Thomas Bogendoerfer Nov. 15, 2024, 9:34 a.m. UTC | #2
On Fri, Nov 15, 2024 at 10:24:29AM +0100, Théo Lebrun wrote:
> Hello Thomas,
> 
> On Wed Nov 6, 2024 at 5:03 PM CET, Théo Lebrun wrote:
> > Now that clk-eyeq is in the clk-next tree, we can add the small(-ish)
> > details required to make the platform work fully. The work is mostly
> > about updating devicetrees to rely on the system-controller nodes as
> > clock providers.
> 
> [...]
> 
> >  - clk:
> >    [PATCH v2 01/10] dt-bindings: soc: mobileye: set `#clock-cells = <1>` for all compatibles
> >    [PATCH v2 02/10] dt-bindings: clock: eyeq: add more Mobileye EyeQ5/EyeQ6H clocks
> >    [PATCH v2 03/10] clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
> >    [PATCH v2 04/10] clk: eyeq: require clock index with phandle in all cases
> >    [PATCH v2 05/10] clk: eyeq: add fixed factor clocks infrastructure
> >    [PATCH v2 06/10] clk: eyeq: add EyeQ5 fixed factor clocks
> >    [PATCH v2 07/10] clk: eyeq: add EyeQ6H central fixed factor clocks
> >    [PATCH v2 08/10] clk: eyeq: add EyeQ6H west fixed factor clocks
> >
> >  - MIPS:
> >    [PATCH v2 09/10] MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks
> >    [PATCH v2 10/10] MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks
> 
> Do you think we can make those two patches go in before the next merge
> window? Stephen just accepted the above patches. This makes both MIPS
> platforms usable on upstream kernels!

I've applied, but not pushed, because this

Error: /local/tbogendoerfer/korg/linux/arch/mips/boot/dts/mobileye/eyeq5.dtsi:20.19-20 syntax error
FATAL ERROR: Unable to parse input treeo

My tree misses the new CLK defines.

I haven't decided whether I'll ignore that and push it now or put them
into a second request vor 6.13.

Thomas.
Théo Lebrun Nov. 15, 2024, 11:06 a.m. UTC | #3
On Fri Nov 15, 2024 at 10:34 AM CET, Thomas Bogendoerfer wrote:
> On Fri, Nov 15, 2024 at 10:24:29AM +0100, Théo Lebrun wrote:
> > On Wed Nov 6, 2024 at 5:03 PM CET, Théo Lebrun wrote:
> > >  - MIPS:
> > >    [PATCH v2 09/10] MIPS: mobileye: eyeq5: use OLB as provider for fixed factor clocks
> > >    [PATCH v2 10/10] MIPS: mobileye: eyeq6h: add OLB nodes OLB and remove fixed clocks
> > 
> > Do you think we can make those two patches go in before the next merge
> > window? Stephen just accepted the above patches. This makes both MIPS
> > platforms usable on upstream kernels!
>
> I've applied, but not pushed, because this
>
> Error: /local/tbogendoerfer/korg/linux/arch/mips/boot/dts/mobileye/eyeq5.dtsi:20.19-20 syntax error
> FATAL ERROR: Unable to parse input treeo
>
> My tree misses the new CLK defines.
>
> I haven't decided whether I'll ignore that and push it now or put them
> into a second request vor 6.13.

It was either breaking the driver build or the DTS builds. I preferred
breaking DTS as that way no kernel robot would come yelling after me.
Sorry it has to fall onto you to handle that.

Thanks,

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