Add support of more than 4 CS for SPI interface

17 views
Skip to first unread message

Kushal

unread,
Apr 27, 2021, 11:35:03 PM4/27/21
to BeagleBone

I am trying to interface 6 mcp4921 devices via SPI1. Beaglebone's SPI1 interface has 2 native CS. I want to add 4 more GPIO CS to SPI1. Total 6 CS. 

I added all 6 CS entries to the device tree's cs-gpios as shown below. 2 native CS + 4 GPIO CS.

cs-gpios = <0>,  
                    <0>, 
                    <&gpio3 19 GPIO_ACTIVE_HIGH>, 
                    <&gpio1 18 GPIO_ACTIVE_HIGH>, 
                    <&gpio1 16 GPIO_ACTIVE_HIGH>, 
                    <&gpio1 17 GPIO_ACTIVE_HIGH>;

While testing I observed that only devices connected to the first 4 CS works well. The transaction with the last 2 devices throws a timeout error (timeout error verified from dmesg).

After looking at am33xx.dtsi and spi-omap2-mcspi.c driver file, it seems like the SPI driver support only 4 CS.

How do I extend the SPI driver to support 6 CS?

The output of version.sh can be found here: https://pastebin.ubuntu.com/p/vsthV7MMP8

Reply all
Reply to author
Forward
0 new messages