zhen8838 Posted July 29, 2018 Posted July 29, 2018 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?
martinayotte Posted July 29, 2018 Posted July 29, 2018 On 7/29/2018 at 1:59 PM, zhen8838 said: spi-jedec-nor Expand Why do you have this overlay ? It may conflict with spidev ...
zhen8838 Posted July 30, 2018 Author Posted July 30, 2018 On 7/29/2018 at 2:36 PM, martinayotte said: Why do you have this overlay ? It may conflict with spidev ... Expand thanks for your advice. But I remove spi-jedec-nor overlay , Still no spidev ...
martinayotte Posted July 30, 2018 Posted July 30, 2018 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...
zador.blood.stained Posted July 30, 2018 Posted July 30, 2018 On 7/30/2018 at 3:26 PM, martinayotte said: It seems that something broken in /boot/dtb/allwinner/overlay/sun50i-h5-fixup.scr script ... It doesn't turn on the status to "okay" ... Expand Which kernel version are we talking about - 4.14 or 4.17?
zhen8838 Posted July 30, 2018 Author Posted July 30, 2018 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?
martinayotte Posted July 30, 2018 Posted July 30, 2018 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...
martinayotte Posted July 30, 2018 Posted July 30, 2018 @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 ?
zhen8838 Posted July 30, 2018 Author Posted July 30, 2018 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 … 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 …
zador.blood.stained Posted July 30, 2018 Posted July 30, 2018 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.
martinayotte Posted July 30, 2018 Posted July 30, 2018 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 ...
zhen8838 Posted July 30, 2018 Author Posted July 30, 2018 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.
zador.blood.stained Posted July 30, 2018 Posted July 30, 2018 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.
martinayotte Posted July 30, 2018 Posted July 30, 2018 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 ...
yam1 Posted July 30, 2018 Posted July 30, 2018 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.
martinayotte Posted July 30, 2018 Posted July 30, 2018 @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 ...
zador.blood.stained Posted July 30, 2018 Posted July 30, 2018 On 7/30/2018 at 5:00 PM, martinayotte said: But we still seeing some leading zeros on some of the fixups, such as A10/A13/A20 ... Expand It's more than just leading 0s, there are other node and label name changes too.
martinayotte Posted July 30, 2018 Posted July 30, 2018 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
5kft Posted July 30, 2018 Posted July 30, 2018 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)
martinayotte Posted July 30, 2018 Posted July 30, 2018 On 7/30/2018 at 6:07 PM, 5kft said: yes, apologies, Expand No needs, we understand that Since I've some A20, I'll probably take care of that when I get chance/time ... 1
zador.blood.stained Posted July 30, 2018 Posted July 30, 2018 On 7/30/2018 at 6:13 PM, martinayotte said: Since I've some A20, I'll probably take care of that when I get chance/time ... Expand I already started the cleanup: https://github.com/armbian/sunxi-DT-overlays/commits/linux-4.17.y For now it should be enough to check .dtsi files to figure out changes first, and let people test everything later.
zhen8838 Posted July 31, 2018 Author Posted July 31, 2018 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 thank you very much . i have solved this problem.
vivekpk Posted April 23, 2019 Posted April 23, 2019 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/
Igor Posted April 23, 2019 Posted April 23, 2019 On 4/23/2019 at 2:54 PM, vivekpk said: i don't see any spi devices Expand I don't see any logs from your machine. Type armbianmonitor -u
vivekpk Posted April 23, 2019 Posted April 23, 2019 On 4/23/2019 at 3:22 PM, Igor said: I don't see any logs from your machine. Type armbianmonitor -u Expand log files is her http://ix.io/1GZ7
martinayotte Posted April 23, 2019 Posted April 23, 2019 On 4/23/2019 at 2:54 PM, vivekpk said: i don't see any spi devices under /dev/ Expand 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" ...
vivekpk Posted April 23, 2019 Posted April 23, 2019 On 4/23/2019 at 3:30 PM, Igor said: What if you start only with spi-dev overlay? Expand you mean without i2c0 and w1-gpio
vivekpk Posted April 23, 2019 Posted April 23, 2019 On 4/23/2019 at 3:33 PM, 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" ... Expand how will i do that
martinayotte Posted April 23, 2019 Posted April 23, 2019 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 ...
Recommended Posts