Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing SPI1 D0 as output #40

Open
rifotu opened this issue Aug 23, 2016 · 5 comments
Open

changing SPI1 D0 as output #40

rifotu opened this issue Aug 23, 2016 · 5 comments

Comments

@rifotu
Copy link

rifotu commented Aug 23, 2016

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)

@cdsteinkuehler
Copy link
Owner

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]

@rifotu
Copy link
Author

rifotu commented Aug 24, 2016

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

@cdsteinkuehler
Copy link
Owner

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]

@rifotu
Copy link
Author

rifotu commented Aug 25, 2016

thanks!
I will try them out and report back.

@rowsail
Copy link

rowsail commented Mar 6, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants