AnsweredAssumed Answered

i.MX8 QM SPIDev clock issue

Question asked by ajithpv on Jun 16, 2019
Latest reply on Jun 18, 2019 by igorpadykov



We are working on a custom project where we need to configure the i.MX8QM SPIDev (via lpspi3) to 24MHz or 16MHz for a slave chip to work. We are using the Linux 4.9.51 kernel.

We have configured several clocks for the spidev as well as lpspi3 ("per", "ipg") but, all are limit to 10MHz. In other words, it will give correct clock till 10MHz and after that, clocks are coming like 4 or 6 MHz (wrong clocks) even if we set it for 16MHz!

Hence, I would like to know how to configure the lpspi3 to output more than 10MHz clock (say 24MHz output for spidev)? Could you please let me know the following:

  1. What is the maximum clock for the spidev if I configure it under lpspi3?
  2. What value need to put under lpspi3 root clock (below) to get 16MHz or 24MHz clock (sample is given):
    lpspi3: lpspi@5a030000 {
                    compatible = "fsl,imx7ulp-spi";
                    reg = <0x0 0x5a030000 0x0 0x10000>;
                    interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>;
                    interrupt-parent = <&gic>;
                    clocks = <&clk IMX8QM_SPI3_CLK>,
                             <&clk IMX8QM_SPI3_IPG_CLK>;
                    clock-names = "per", "ipg";
                    assigned-clocks = <&clk IMX8QM_SPI3_CLK>;
                    assigned-clock-rates =
    <80000000>; //???
                    power-domains = <&pd_dma_lpspi3>;
  3. What value need to put under spidev maximum clock (below) to get 16MHz or 24MHz clock (sample is given):
    &lpspi3 {
            pinctrl-names = "default";
            pinctrl-0 = <&pinctrl_lpspi3>;
            cs-gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";

            spidev0: spi@0 {
                    reg = <0>;
                    compatible = "rohm,dh2228fv";
                    spi-max-frequency =
    <16000000>; //???

PS: Since, the i.MX8 QM is in pre-production stage, the reference manual doesn't contain any SPI clock related information.


Any help would be appreciated.