how to enable SPI in LS1043a

cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable SPI in LS1043a

942 Views
yanggao
Contributor III

Hi,

 

I'm working with LS1043A and yocto poky, and I am trying to communicate over the SPI. In the menuconfig, I have enabled all these options:

#
# Other I2C/SMBus bus drivers
#
CONFIG_SPI=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y

#
# SPI Master Controller Drivers
#
# CONFIG_SPI_ALTERA is not set
# CONFIG_SPI_BITBANG is not set
# CONFIG_SPI_CADENCE is not set
# CONFIG_SPI_GPIO is not set
CONFIG_SPI_FSL_LIB=y
CONFIG_SPI_FSL_SPI=y
CONFIG_SPI_FSL_DSPI=y
# CONFIG_SPI_OC_TINY is not set
CONFIG_SPI_PL022=y
# CONFIG_SPI_PXA2XX is not set
# CONFIG_SPI_PXA2XX_PCI is not set
# CONFIG_SPI_ROCKCHIP is not set
# CONFIG_SPI_QUP is not set
# CONFIG_SPI_S3C64XX is not set
# CONFIG_SPI_SC18IS602 is not set
# CONFIG_SPI_TEGRA20_SFLASH is not set
# CONFIG_SPI_XCOMM is not set
# CONFIG_SPI_XILINX is not set
# CONFIG_SPI_DESIGNWARE is not set

#
# SPI Protocol Masters
#
CONFIG_SPI_SPIDEV=y
# CONFIG_SPI_TLE62X0 is not set
# CONFIG_SPMI is not set
# CONFIG_HSI is not set 

and in the fsl-ls1043a.dtsi, I added as follows:

dspi0: dspi@2100000 {
   compatible = "fsl,ls1043a-dspi", "fsl,ls1021a-v1.0-dspi";
   #address-cells = <1>;
   #size-cells = <0>;
   reg = <0x0 0x2100000 0x0 0x10000>;
   interrupts = <0 64 0x4>;
   clock-names = "dspi";
   clocks = <&clockgen 4 0>;
   spi-num-chipselects = <5>;
   big-endian;
   status = "ok";

   bus-num = <0>;


   spidev:spi@0 {
   #address-cells = <1>;
   #size-cells = <1>;
   compatible = "spidev";
   reg = <0>;
   spi-max-frequency = <108000000>;
   };
};

After the compilation, there is not /dev/spidev. I would like to know how to enable SPI in LS1043a?

Thanks in advance!

Labels (1)
0 Kudos
3 Replies

309 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello yang gao,

I have verified your configuration on LS1043ARDB board, /dev/spidev0.0 can be created in Linux User Space.

Please check whether there is hardware problem on your target board.

Under u-boot prompt, please run the following command to check whether the SPI device can be detected.

=> sf probe

Would you please provide you Linux Kernel booting up log?

Under Linux, please run the following command to check whether the SPI device has been registered.

root@ls1043ardb:~# dmesg | grep spi


Have a great day,
TIC

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

0 Kudos

309 Views
yanggao
Contributor III

Hi Yiping,

That's hardware problem. Thank you very much!

Have a great day,

Yang

0 Kudos

309 Views
yanggao
Contributor III

Hi Yiping,

Many thanks for your email.

Now I compiled SPI as module and I have changed CONFIG_SPI_SPIDEV=m in

.config file, I can create /dev/spidev0.0. But according to the booting

log, it seems there are some errors. And the SCK signal of LS1043a is

always at high even I used the command: echo 1 > /dev/spidev0.0. I send you

in attachment the booting log, could you please help me to verify it?

Otherwise, I don't understand why I set CONFIG_SPI_SPIDEV=y not as a

module, it does not work?

Once again thank you very much for all your help!

Best regards,

Yang GAO

2018-03-21 9:29 GMT+01:00 Yiping Wang <admin@community.nxp.com>:

NXP Community

<https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

You have been mentioned

by Yiping Wang

<https://community.nxp.com/people/yipingwang?et=notification.mention> *in

Re: how to enable SPI in LS1043a in NXP Community* - View Yiping Wang's

reference to you

<https://community.nxp.com/message/997731?commentID=997731&et=notification.mention#comment-997731>

0 Kudos