SPI Driver Implementation
Jan.Sommer at dlr.de
Jan.Sommer at dlr.de
Wed Feb 10 07:37:24 UTC 2021
Hi Rick,
> -----Original Message-----
> From: users <users-bounces at rtems.org> On Behalf Of Rick VanderWal
> Sent: Tuesday, February 9, 2021 9:21 PM
> To: users at rtems.org
> Subject: SPI Driver Implementation
>
> Hey All,
>
> I am looking for guidance in regards to the implementation of a SPI bus driver
> for my Zynq-700 based board. I saw I2C bus driver implementations for
> Cadence and Xilinx-AXI, but did not see any SPI drivers. Please point me in
> the right direction if I missed something.
>
You are right, there is currently no implementation for the cadence-SPI on the PS nor for the Xilinx-AXI-SPI for the PL.
I have a driver for the cadence-SPI implemented, but lab access is currently quite limited and I haven't had the chance to test it with hardware.
So my best guess is that it won't work without some debugging. If you want to try your luck and test/debug it, I can send you my current state.
A driver for the Xilinx-AXI-SPI is on my list, but I haven't started any implementation yet.
>
> Assuming they need to be developed, I looked at the RTEMS 6 BSP and
> Driver Guide that specifies the use of the "SPI bus framework". However, I
> have looked at some of the Arm BSPs included with RTEMS and they all seem
> to use the libi2c library that is part of the cpukit. It claims to support both I2C
> and SPI.
>
I think the preferred way is to use the libi2c API for i2c devices only and use the Linux spidev API for SPI devices.
In the docs are a few drivers which already implement the spidev API (https://docs.rtems.org/branches/master/bsp-howto/spi.html).
For the cadence-SPI driver I used the general layout of the NXP i.MX SPI driver linked there and implemented it according to the data sheet from Xilinx.
Best regards,
Jan
>
> Therefore, what is the correct or preferred way to develop a new driver
> should I need to create it. I'll gladly provide the implementation back to the
> project.
>
>
> As always, thank you for you time and help.
>
>
> Regards,
>
> -Rick
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
More information about the users
mailing list