beaglebone-universal-io icon indicating copy to clipboard operation
beaglebone-universal-io copied to clipboard

changing SPI1 D0 as output

Open rifotu opened this issue 8 years ago • 5 comments

Hello,

I don't see a way to configure SPI1 D0 as output (MOSI). Is there a way to change it? If not, can you please tell me where I should change in the source code to swap MOSI and MISO (D1 and D0)

rifotu avatar Aug 23 '16 22:08 rifotu

On 8/23/2016 5:00 PM, rifotu wrote:

Hello,

I don't see a way to configure SPI1 D0 as output (MOSI). Is there a way to change it? If not, can you please tell me where I should change in the source code to swap MOSI and MISO (D1 and D0)

I don't use the SPI and am not sure if there is a way to swap these pins. If there is a way, it's probably via device tree settings.

You should ask on the BeagleBoard Google group and/or dig through the kernel documentation and SPI driver source code.

Charles Steinkuehler [email protected]

cdsteinkuehler avatar Aug 24 '16 16:08 cdsteinkuehler

Hello,

Beagleboard supports changing D0 and D1 as MOSI or MISO. There are overlay files for choosing which one is MOSI in the below link. http://elinux.org/BeagleBone_Black_Enable_SPIDEV -> example overlay

The keyword is ti,pindir-d0-out-d1-in https://github.com/beagleboard/linux/blob/4.4/Documentation/devicetree/bindings/spi/omap-spi.txt#L9

I just wasn't able to find where to change in universal-io source code to have this. Can you please guide me where to change to have that configuration support

thanks a lot rifo

rifotu avatar Aug 24 '16 16:08 rifotu

On 8/24/2016 11:45 AM, rifotu wrote:

I just wasn't able to find where to change in universal-io source code to have this. Can you please guide me where to change to have that configuration support

You will need to create a custom version of the universal overlay to get this to work. Remember to rename it or you will always load the version built into the kernel.

You need to change the spi device entry and add the ti,pindir-d0-out-d1-in line: https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L1667-L1698

You may also need to change the spi mode pinmux values for the two pins:

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L643

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L661

Charles Steinkuehler [email protected]

cdsteinkuehler avatar Aug 24 '16 23:08 cdsteinkuehler

thanks! I will try them out and report back.

rifotu avatar Aug 25 '16 17:08 rifotu

Thinking about it - I am going definitely going to change the PCB - so do not worry about that extra hassle of swapping D0 and D1.

rowsail avatar Mar 06 '19 22:03 rowsail