Jump to content

How to configure dtb and overlays on bananapi m1+ to get /dev/spidev0.0 and /dev/spidev0.1 at the same time


Recommended Posts

I've tried many permutations of overlays and user-overlays and I can get /dev/spidev0.0 or /dev/spidev0.1 to be present, but I can't seem to get both simultaneously.  I need both to migrate a project from an older Fedora distribution relying on modprobe to the latest version of Armbian.  Any suggestions will be greatly appreciated!


I started with very recent Armbian 23.02 Bullseye XFCE downloaded from arbian.com/banana-pi-plus ..




and I added the following to the /boot/armbianEnv.txt file, as described in the Armbian page associated with the BananaPi M1+ ..




I also added these overlays at the same file ..


overlay=spi-spidev spi-add-cs1



After reboot, I see one /dev/spidev device:


 # ls /dev/sp*



If instead, I also add ..




Then after reboot, I see a device for the other chip select, only ..


# ls /dev/sp*



but I can't find a means to have access to both simultaneously. 


As an aside, I also tried the following;  Through some searching in the forum, I found a link to a promising overlay ..


armbian / sunxi-DT-overlays / examples / spi-double-spidev-cs.dts


Contents shown below ..



I downloaded this and compiled it using ..


dtc -@ -I dts -O dtb -o /boot/overlay-user/spi-double-spidev-cs.dtbo spi-double-spidev-cs.dts


Then, since the thread said, "You will still need to use spidev-add-cs1 overlay but remove spi-spidev one because the custom one will be used instead of it,"  I used the following in the /boot/armbianEnv.txt file ..





I confirmed the user overlay did load ..




But this produced neither /dev/spidev0.0 or /dev/spidev0.1.


Any ideas?  I'd rather not have to compile the kernel since I'd have to outfit a whole new development environment for that, so I'm hoping this can be done with dts or dtbo files.  Any tips or hints on which direction I should go next will be GREATLY appreciated. Thank you.



Link to comment
Share on other sites

Hi There,


Those overlays are a bit old but should hopefully work with one minor change. Try replacing the compatible field with compatible = "armbian,spi-dev" and see if this works. From what I understand there was a change to the kernel since version 5.15 which removed the old spidev driver.


Best of luck 



Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines