Tobias Posted March 4 Posted March 4 (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 March 4 by Tobias 0 Quote
Werner Posted March 4 Posted March 4 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 0 Quote
Tobias Posted March 4 Author Posted March 4 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 0 Quote
Werner Posted March 4 Posted March 4 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. 0 Quote
Andrei Aldea Posted March 8 Posted March 8 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 You'll want to select Device (not Software Product) and click start.... 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 - 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 0 Quote
Recommended Posts
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.