Jump to content

Recommended Posts

Posted (edited)

Hi, is it possible to use spidev on sk-am64b?

 

when i run

 ls /dev/spidev*

it return nothing so i suppose its not enabled by default. 

 

Regards

Tobias

 

Edited by Tobias
Posted

I don't think any board has spi, i2c or similar enabled by default. It is all done via device tree overlays. Check if there are some available for your board by navigating to /boot/dtb/whateverstandshere/overlay

Posted

Ok, thank you. I cant find the overlay folder (probably because no overlays exist for sk-am64b). 

 

I have found some information regarding SPIDEV for my board here: https://software-dl.ti.com/processor-sdk-sitara/esd/am64x/latest/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/SPI.html.

It actually show an example of a device tree. Do someone know if there exist overlays that is known to be working or do i have to create my own?

 

Regards

Tobias

Posted

I just check the sources from ti and it seems like they dont provide much overlays by themselves, so it seems you have to come up with something on your own.

Posted

Hey Tobias, 

 

Indeed there aren't many examples but to point you in the right direction:

 

TI offers a web tool that you can also download called Sysconfig that lets you generate DTS files so you can find the right pin files (you'll need to match your config parameters with EVM schematic)

https://www.ti.com/tool/SYSCONFIG 

Screenshot2025-03-08at2_02_38PM.thumb.png.81ccb47344fd5bde074b2241845321df.png

You'll want to select Device (not Software Product) and click start....

 

Screenshot2025-03-08at2_03_39PM.thumb.png.627f4055970ca55ff46e7e04ea4d98d1.png

Then you can add a SPI node and match your pins etc, and you'll see it generates a device tree.dtsi files with the right pins for you. Something like this - 

 

Screenshot2025-03-08at2_03_59PM.thumb.png.1e0511fcd821fef98d7b3cb538dc930a.png

 

From there, to enable Spidev itself I would look at examples from BeagleBoard like this and adjust for your needs, this should give you the spidev node-

 

https://openbeagle.org/beagleboard/BeagleBoard-DeviceTrees/-/blob/v6.12.x-Beagle/src/arm64/overlays/k3-am67a-beagley-ai-spidev0.dtso?ref_type=heads 

 

Note - you might notice some oddity with "compatible = "rohm,dh2228fv";" - That's one of those weird things about embedded Linux, my understanding is that the Spidev maintainers don't really want you to just attach "any" device, they want you to specify the exact device that SPI will be connected to but if you'r developing you can use some of those older drivers to kind of force it to be have generically. 

 

Let me know if that helps :)

 

 

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines