How to Set SPI's Clock

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Set SPI's Clock

Jump to solution
1,404 Views
jiehunt
Contributor II

I use the imx6ql-sabreauto board to communicate with a slave board.

I want to know the highest speed of spi block.

I read the document and i think the highest speed is up to 60MHz.

and i use the ioctl like this

 ioctl (fd, SPI_IOC_WR_MAX_SPEED_HZ, 60MHz)

But , I don't confirm whether this is effective or not.

How do I know the actual speed of the SPI work with?

Thank you!

Labels (2)
0 Kudos
1 Solution
1,071 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jie

max. ecspi frequency can be found in sect.4.11.2 ECSPI Timing Parameters

i.MX6DQ Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf

example of usage with spi-nor flash using dts "spi-max-frequency" parameter in

imx6qdl-sabresd.dtsi

linux-2.6-imx.git - Freescale i.MX Linux Tree 

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

View solution in original post

0 Kudos
2 Replies
1,072 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jie

max. ecspi frequency can be found in sect.4.11.2 ECSPI Timing Parameters

i.MX6DQ Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6DQCEC.pdf

example of usage with spi-nor flash using dts "spi-max-frequency" parameter in

imx6qdl-sabresd.dtsi

linux-2.6-imx.git - Freescale i.MX Linux Tree 

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

0 Kudos
1,071 Views
jiehunt
Contributor II

Thank you for your answer.

Actually my imx6qdl-sabreauto.dtsi is like this:

&ecspi1{
  fsl,spi-num-chipselects = <1>;
  cs-gpios = <&gpio5 25 0>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_ecspi1>;
  status = "okay";
  spidev0: spi@0 {
  compatible = "spidev";
  spi-max-frequency = <40000000>;
  reg = <0>;
  };
};

So, I think the SPI is work with 40MHz. 

0 Kudos