Jump to content

Recommended Posts

Posted

 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?

Posted

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

Posted

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

Posted
  On 7/30/2018 at 3:32 PM, zador.blood.stained said:

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

Expand  

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

Posted
  On 7/30/2018 at 3:37 PM, 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".

Expand  

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

Posted
  On 7/30/2018 at 3:41 PM, zador.blood.stained said:

Not surprising given the number of DT changes between 4.14 and 4.17

Expand  

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

 

Posted
  On 7/30/2018 at 3:39 PM, 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 ?

Expand  

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

Posted
  On 7/30/2018 at 3:49 PM, 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 ...

Expand  

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.

Posted
  On 7/30/2018 at 3:54 PM, zador.blood.stained said:

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

Expand  

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

Posted

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.

Posted
  On 7/30/2018 at 5:03 PM, zador.blood.stained said:

It's more than just leading 0s, there are some node and label name changes too.

Expand  

Right ! need more consistencies ...

I've just figured out on my Pine64 4.14 that it was the reverse : fixup script didn't have leading zero, but the board dtb had some for SPIs :(

Posted
  On 7/30/2018 at 5:00 PM, 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 ...

Expand  

 

@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)

Posted
  On 7/29/2018 at 1:59 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?

Expand  

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

Posted
  On 4/23/2019 at 3:36 PM, vivekpk said:

you mean without i2c0 and w1-gpio

Expand  

It depends : are you using those ?

  On 4/23/2019 at 3:36 PM, vivekpk said:

how will i do that

Expand  

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.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines