Rock5B SPI0 not able to set assigned-clock-rates as 1MHz

Hi All,

I have configured spi0 in the device tree to use assigned-clock-rates as 1MHz. But I could see that ROCK5B is not able to set it as I see the message “clk: couldn’t set clk_spi0 clk rate to 1000000 (-22), current rate: 198000000” in the dmesg. Does this means that 198000000 is the minimum assigned-clock-rate we can set for ROCK5B SPI0? Does this is a ROCK5B hardware limitation? My device tree changes are as follows.

&spi0 {
status = “okay”;
assigned-clocks = <&cru CLK_SPI0>;
assigned-clock-rates = <2000000>;
pinctrl-names = “default”;
pinctrl-0 = <&spi0m2_pins &spi0_interrupt_pin &spi0_reset_pin>;
num-cs = <1>;
spidev@0{
compatible = “linux,spidev”;
reg = <0>; // Chip select number
interrupt-parent = <&gpio3>;
interrupts = <RK_PA7 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = “spi0_irq”;
};
};

Thanks in advance for any help.

Best regards,
Pradeep

I have defined a derivative clock for spi0 based on the Peripheral clock. Does this is fine?

&cru {
spi0_pclk: spi0-pclk {
compatible = “fixed-factor-clock”;
clocks = <&cru PCLK_SPI0>;
clock-div = <100>;
clock-mult = <1>;
#clock-cells = <0>;
};
};

&spi0 {
status = “okay”;
assigned-clocks = <&spi0_pclk>;
assigned-clock-rates = <1000000>;
pinctrl-names = “default”;
pinctrl-0 = <&spi0m2_pins &spi0_interrupt_pin &spi0_reset_pin>;
num-cs = <1>;
spidev@0{
compatible = “linux,spidev”;
reg = <0>; // Chip select number
interrupt-parent = <&gpio3>;
interrupts = <RK_PA7 IRQ_TYPE_EDGE_FALLING>;
interrupt-names = “spi0_irq”;
};
};

Does the Rockchip SPI controller driver in Linux, spi-rockchip.c has support for rk3588?