Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OPZ+2 H5 enable SPi but no /dev/spi-dev

Featured Replies

 I use the Armbian_5.45_Orangepizeroplus2-h5_Debian_stretch_next_4.14.44.img.

I want to use a sensor based on the spi protocol. In armbian-config i enable the spi ,the armbianEnv.txt like this:

verbosity=1
console=both
overlay_prefix=sun50i-h5
overlays=i2c0 i2c1 spdif-out spi-add-cs1 spi-jedec-nor spi-spidev uart1 uart2 usbhost2 usbhost3
rootdev=UUID=bb48b498-7bd1-4018-b77d-ba00fa61a33d
rootfstype=ext4
param_uart1_rtscts=1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

But in /dev  on spi-dev

root@H5:~# ls /dev/s
shm/    snd/    stderr  stdin   stdout 

 

Is it because there is no code adaptation spi-dev?

if not ,I want to try to transplant the spi-dev code,Can give me some guiding advice?

  • Author
11 hours ago, martinayotte said:

Why do you have this overlay ? It may conflict with spidev ...

 

thanks for your advice. But I remove spi-jedec-nor overlay , Still no spidev ...

 

It seems that something broken in /boot/dtb/allwinner/overlay/sun50i-h5-fixup.scr script ... It doesn't turn on the status to "okay" ...

 

In the mean time we found a fix, use the DTBO attached and apply it with the following commands :

 

mkdir /sys/kernel/config/device-tree/overlays/spidev
cat spi1dev-fix.dtbo > /sys/kernel/config/device-tree/overlays/spidev/dtbo

BTW, @zador.blood.stained , did you know about this issue ? was it introduce when we switched to newer u-boot ?

 

spi1dev-fix.dtbo

  • Author

I get the source and find the linux-4.17-y/arm64/boot/dts/allwinner/overlay/sun50i-h5-spi-spidev.dts : the spi status is disable.

I modified “disable” to “okay”, then rebuild the .dts to .dtbo . and put the sun50i-h5-spi-spider.dtbo into the board. 

finally i insmod /lib/module/linux-4.17-y/kernel/drives/spi/spidev.ko But still can’t fix this problem … 

does anybody can help me?

 

99BA978E-7FA0-48B7-BFC5-7A8A74A55935.png

7 minutes ago, zador.blood.stained said:

Which kernel version are we talking about - 4.14 or 4.17?

It is on a recent 4.17 on both OPiZ+2 and OPi+2E, but applying my above DTBO directly in /sys/kernel/config/device-tree/overlays is working, which only adding "okay", so I presume it is the fixup script in u-boot that doesn't apply the "okay".

I will try to see if in previous 4.14 the issue was present...

  • Author
5 minutes ago, zador.blood.stained said:

Which kernel version are we talking about - 4.14 or 4.17?

… i am noob .last month i build my board kernel version is 4.14 ,but now i don’t know how to build the last version kernel …

2 minutes ago, martinayotte said:

It is on a recent 4.17 on both OPiZ+2 and OPi+2E, but applying my above DTBO directly in /sys/kernel/config/device-tree/overlays is working, which only adding "okay"

, so I presume it is the fixup script in u-boot that doesn't apply the "okay".

Not surprising given the number of DT changes between 4.14 and 4.17.  Almost all overlays need adjustments for newer kernel versions.

  • Author
18 minutes ago, martinayotte said:

@zhen8838 The "okay" are applied by the /boot/dtb/allwinner/overlay/sun50i-h5-fixup.scr script when the "param_spidev_spi_bus" is provided in armbianEnv.txt.

See the doc here : https://docs.armbian.com/Hardware_Allwinner_overlays/

 

In the mean time, did you try my own DTBO ?

thanks for  your reply. i will read the doc to learn more .I will try your dtbo tomorrow.

1 minute ago, martinayotte said:

I've tested on my Pine64 with 4.14 and the issue is still there : the overlay itself is loaded (since spidev appears in DT) but the "okay" of fixup script are not there ...

A64 SPI was added upstream only in 4.15 so it's possible that there are some inconsistencies between SPI DT patches and overlay patches. But since people added several overlays directly to kernel patches I'm not even sure which sunxi-DT-overlays revision we had and have right now in sunxi-next and sunxi-dev trees.

9 minutes ago, zador.blood.stained said:

it's possible that there are some inconsistencies between SPI DT patches and overlay patches.

I've edited the overlay itself to have status "okay" directly there, and it is working. So, it is really the "fixup" script that doesn't seems to execute the "fdt set /soc/spi@1c68000 status okay" and "fdt set /soc/spi@1c68000/spidev status okay" properly...

I'm doing a new build which will add a "fdt print /soc/spi@1c68000" while executing the "fixup", we will see ...

The issue is question is missing spidev argument: param_spidev_spi_bus=0

 

I can confirm spi_spidev works in 4.17.11. 

 

But I could not get other user device tree overlays to work properly in 4.17.11.

1 hour ago, martinayotte said:

@zador.blood.stained , I've found it ! It is already fixed 8 days ago by @5kft ! My builds were older than that ...

 

https://github.com/armbian/build/commit/8d092c22e06f2a105b957ff0bbed1f221ed4a688#diff-3e167ca28e6d1bc614dd30bc33eb7fab

 

But we still seeing some leading zeros on some of the fixups, such as A10/A13/A20 ...

 

@martinayotte, @zador.blood.stained - yes, apologies, I only fixed the entries for boards that I could test my changes against (i.e., H3/H5).  Unfortunately I don't have any A10/A13/A20-based boards, and I didn't feel comfortable making changes that I couldn't test...  (This would especially be a problem if some of the other nodes/labels changed as well, and I couldn't test them)

On 7/29/2018 at 7:29 PM, zhen8838 said:

 I use the Armbian_5.45_Orangepizeroplus2-h5_Debian_stretch_next_4.14.44.img.

I want to use a sensor based on the spi protocol. In armbian-config i enable the spi ,the armbianEnv.txt like this:


verbosity=1
console=both
overlay_prefix=sun50i-h5
overlays=i2c0 i2c1 spdif-out spi-add-cs1 spi-jedec-nor spi-spidev uart1 uart2 usbhost2 usbhost3
rootdev=UUID=bb48b498-7bd1-4018-b77d-ba00fa61a33d
rootfstype=ext4
param_uart1_rtscts=1
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

But in /dev  on spi-dev


root@H5:~# ls /dev/s
shm/    snd/    stderr  stdin   stdout 

 

Is it because there is no code adaptation spi-dev?

if not ,I want to try to transplant the spi-dev code,Can give me some guiding advice?

 I am having the same issue with Banana PI M2+ H3 board 
i don't see any spi devices under /dev/

2 minutes ago, Igor said:


I don't see any logs from your machine. Type armbianmonitor -u 

 
log files is her http://ix.io/1GZ7

4 minutes ago, Igor said:

What if you start only with spi-dev  overlay?

you mean without i2c0 and w1-gpio 

2 minutes ago, martinayotte said:

The spi-spidev has some requirement to be met, it is not as simply load it in overlays list, it requires the "param_spidev_spi_bus" ...

how will i do that

34 minutes ago, vivekpk said:

you mean without i2c0 and w1-gpio

It depends : are you using those ?

33 minutes ago, vivekpk said:

how will i do that

Simply edit again /boot/armbianEnv.txt and add "param_spidev_spi_bus=0" or "param_spidev_spi_bus=1" depending which bus you want to activate... and then reboot ...

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.