Hi Shimoda-san, On Thu, Dec 22, 2022 at 10:33 AM Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote: > Enable UFS device for R-Car S4-8 Spider CPU board. > > Note that the conditions of RC21012 on the Spider are: > - OUT11 (for UFS30_REFCLK_V) is disabled as default. > - OUT11 is controlled by GPIO0 pin. > - The GPIO0 pin is inverted sense (low active) and pull-up enabled. Thanks for your patch! > To output the clock, pin 4 of TCA9554 on the Spider board needs to > output low level so that using "gpio-gate-clock" for it. Does this mean the GPIO setup was the only missing part, and the i2c commands from [1] were not needed? I wanted to give this a try, but the remote Spider is offline. > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> > --- > .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 37 +++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi > index 25b34d66061a..32625afc74bf 100644 > --- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi > +++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi > @@ -5,6 +5,7 @@ > * Copyright (C) 2021 Renesas Electronics Corp. > */ > > +#include <dt-bindings/gpio/gpio.h> > #include "r8a779f0.dtsi" > > / { > @@ -32,6 +33,12 @@ memory@480000000 { > reg = <0x4 0x80000000 0x0 0x80000000>; > }; > > + rc21012_ufs: clk-rc21012-ufs { > + compatible = "fixed-clock"; > + clock-frequency = <38400000>; > + #clock-cells = <0>; > + }; So you're modelling the RC21012 output as a fixed clock. I guess that's acceptable until a proper driver is available. > +&ufs30_clk { > + compatible = "gpio-gate-clock"; > + clocks = <&rc21012_ufs>; > + enable-gpios = <&gpio_exp_20 4 GPIO_ACTIVE_LOW>; Perhaps the "clock-frequency" property should be removed using /delete-property/? > +}; Alternatively, you could have kept ufs30_clk as a fixed-clock, dropped rc21012_ufs, and added a gpio hog. But I do like your description, as it clearly shows how the GPIO interacts with the RC21012. The i2c part LGTM, and is identical to [2]. [1] "https://lore.kernel.org/all/20220603110524.1997825-1-yoshihiro.shimoda.uh@xxxxxxxxxxx" https://lore.kernel.org/all/20220603110524.1997825-1-yoshihiro.shimoda.uh@xxxxxxxxxxx [2] "[PATCH] arm64: dts: renesas: spider-cpu: add i2c0 bus" https://lore.kernel.org/all/20221220121959.45779-1-wsa+renesas@xxxxxxxxxxxxxxxxxxxx Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds