arm64: dts: renesas: r8a779f0: spider: Enable PCIe Host ch0
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 5 Sep 2023 01:24:04 +0000 (10:24 +0900)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 11 Sep 2023 11:41:25 +0000 (13:41 +0200)
Enable PCIe Host controller channel 0 on R-Car S4-8 Spider board.

Since this board has an Oculink connector, CLKREQ# pin of PFC for PCIe
should not be used. So, using a GPIO is used to output the clock instead.
Otherwise the controller cannot detect a PCIe device.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230905012404.2915246-3-yoshihiro.shimoda.uh@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi

index 5cbde8e8fcd5cac30b7ef8c5109867b32fd4a2a8..477f3114d2fd403010163ebce024cf33651cdcd5 100644 (file)
                reg = <0x4 0x80000000 0x0 0x80000000>;
        };
 
+       rc21012_pci: clk-rc21012-pci {
+               compatible = "fixed-clock";
+               clock-frequency = <100000000>;
+               #clock-cells = <0>;
+       };
+
        rc21012_ufs: clk-rc21012-ufs {
                compatible = "fixed-clock";
                clock-frequency = <38400000>;
                reg = <0x20>;
                gpio-controller;
                #gpio-cells = <2>;
+
+               rc21012-gpio2-hog {
+                       gpio-hog;
+                       gpios = <5 GPIO_ACTIVE_LOW>;
+                       output-high;
+               };
        };
 };
 
        status = "okay";
 };
 
+&pcie0_clkref {
+       compatible = "gpio-gate-clock";
+       clocks = <&rc21012_pci>;
+       enable-gpios = <&gpio2 15 GPIO_ACTIVE_LOW>;
+       /delete-property/ clock-frequency;
+};
+
+&pciec0 {
+       reset-gpio = <&gpio_exp_20 0 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
 &pfc {
        pinctrl-0 = <&scif_clk_pins>;
        pinctrl-names = "default";