i.MX8 QM SPIDev clock issue

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX8 QM SPIDev clock issue

769 Views
ajithpv
Contributor V

Hi,

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.

0 Kudos
3 Replies

298 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Ajith

there is no Clock Tree for the i.MX8QM, nor is there going to be a CCM chapter. Maybe the best way to think about clocks on the i.MX8QM is in terms of the Clock Cloud. There is a Distributed Slave System Controller much like the cloud which “takes care” of the clocks, coordinated from the System Control Unit.

First suggestion is try latest Linux L4.14.98_2.0.0 Documentation

linux-imx - i.MX Linux kernel 

Reason for limit to 10MHz may be that lpspi3 uses default clock settings, so one can try to increase its

clock frequency in scfw using SCFW Porting Kit as in example below

pastedImage_2.jpg

for other questions suggest to apply to NXP Professional Services | NXP 

since this part is not officially released yet and not supported.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

298 Views
ajithpv
Contributor V

Thank you for your reply.


We will try with the SCFW changes mentioned for the SPI clock.

Meanwhile, may I know the reason for upgrading to the latest Linux kernel 4.14.98 for this SPI clock issue? Are you suspecting any problems with Linux kernel 4.9.51?

We are already using the 4.9.51 kernel and all other modules except SPI chip is working fine. So, we can move into a latest kernel only if 4.9.51 kernel SPI have some known issues/errata.

Please let me know the details.

Thank you in advance.

0 Kudos

298 Views
igorpadykov
NXP TechSupport
NXP TechSupport

>Meanwhile, may I know the reason for upgrading to the latest Linux kernel 4.14.98

>for this SPI clock issue? Are you suspecting any problems with Linux kernel 4.9.51?

for i.MX8QM Linux kernel 4.9.51 is "beta" quality - please check Release Notes document

which processors are supported in each kernel release:

Linux documentation
https://www.nxp.com/support/developer-resources/run-time-software/i.mx-developer-resources/i.mx-6ser...

Best regards
igor

0 Kudos