riscv: dts: microchip: fix usage of fic clocks on mpfs
authorConor Dooley <conor.dooley@microchip.com>
Wed, 13 Apr 2022 07:58:30 +0000 (08:58 +0100)
committerStephen Boyd <sboyd@kernel.org>
Sat, 23 Apr 2022 01:40:07 +0000 (18:40 -0700)
The fic clocks passed to the pcie controller and other peripherals in
the device tree are not the clocks they actually run on. The fics are
actually clock domain crossers & the clock config blocks output is the
mss/cpu side input to the interconnect. The peripherals are actually
clocked by fixed frequency clocks embedded in the fpga fabric.

Fix the device tree so that these peripherals use the correct clocks.
The fabric side FIC0 & FIC1 inputs both use the same 125 MHz, so only
one clock is created for them.

Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree")
Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20220413075835.3354193-4-conor.dooley@microchip.com
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi
arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi

index 854320e17b285028526621903b312951684e546d..ccaac3371cf99a7fbb960428831b6fffbdf28c1d 100644 (file)
@@ -7,7 +7,7 @@
                reg = <0x0 0x41000000 0x0 0xF0>;
                microchip,sync-update-mask = /bits/ 32 <0>;
                #pwm-cells = <2>;
-               clocks = <&clkcfg CLK_FIC3>;
+               clocks = <&fabric_clk3>;
                status = "disabled";
        };
 
                reg = <0x0 0x44000000 0x0 0x1000>;
                #address-cells = <1>;
                #size-cells = <0>;
-               clocks = <&clkcfg CLK_FIC3>;
+               clocks = <&fabric_clk3>;
                interrupt-parent = <&plic>;
                interrupts = <122>;
                clock-frequency = <100000>;
                status = "disabled";
        };
+
+       fabric_clk3: fabric-clk3 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <62500000>;
+       };
+
+       fabric_clk1: fabric-clk1 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <125000000>;
+       };
 };
index c5c9d1360de074a3bd9e81199e07029e104b91d0..3b48b7f3541065164189f2ee682f78e364b0c77e 100644 (file)
                                        <0 0 0 3 &pcie_intc 2>,
                                        <0 0 0 4 &pcie_intc 3>;
                        interrupt-map-mask = <0 0 0 7>;
-                       clocks = <&clkcfg CLK_FIC0>, <&clkcfg CLK_FIC1>, <&clkcfg CLK_FIC3>;
+                       clocks = <&fabric_clk1>, <&fabric_clk1>, <&fabric_clk3>;
                        clock-names = "fic0", "fic1", "fic3";
                        ranges = <0x3000000 0x0 0x8000000 0x20 0x8000000 0x0 0x80000000>;
                        msi-parent = <&pcie>;