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

Posted

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 ..

 

Armbian_23.02.2_Bananapi_bullseye_current_5.15.93_xfce_desktop.img

 

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

  

fdtfile=sun7i-a20-bananapi-m1-plus.dtb

 

I also added these overlays at the same file ..

 

overlay=spi-spidev spi-add-cs1

param_spidev_spi_bus=0

 

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

 

 # ls /dev/sp*

 /dev/spidev0.0

 

If instead, I also add ..

 

param_spidev_spi_cs=1

 

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

 

# ls /dev/sp*

 /dev/spidev0.1

 

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 ..

image.png.49d6beb305f0cc20256903ee7f151202.png

 

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 ..

 

overlays=spi-add-cs1

user_overlays=spi-double-spidev-cs

 

I confirmed the user overlay did load ..

 

image.thumb.png.ab2d148a78fc48703b26e4950930c3d5.png

 

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.

 

 

Posted

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 

 

Ryzer

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