spaceship Posted February 14, 2019 Posted February 14, 2019 Hello, it seems like there are no dts files to add support for i2s. How hard would it be to complete this task? The documentation from h6 references support for i2s, and the same in the user manual from Xunlog :http://dl.sumnic.com/download/OrangePi-One-Plus.pdf Edit:After some reading, i2s is not working for now and there's no proper driver yet. Thanks to martinayotte, SPI is working.
Igor Posted February 14, 2019 Posted February 14, 2019 Start here: and proceed here:https://github.com/armbian/sunxi-DT-overlays I2S for H6 is missing: https://github.com/armbian/sunxi-DT-overlays/tree/master/sun50i-h6
spaceship Posted February 14, 2019 Author Posted February 14, 2019 Thank you Igor, i'll take a good look at it.
spaceship Posted February 15, 2019 Author Posted February 15, 2019 It seems too much for now, to write a proper driver for i2s. we are trying to make spi work out. This is what we have tried: > download dts file and run : sudo armbian-add-overlay sun50i-h6-spi-spidev.dts > Check armbianEnv.txt after reboot and there were new lines > Added manually to previous file : param_spidev_spi_bus=0 > reboot again > Nothing new at /dev/ Some people seem to be able to do the following : > mkdir /sys/kernel/config/device-tree/overlays/spi > cat spidev-enable.dtbo > /sys/kernel/config/device-tree/overlays/spi/dtbo/sys/ doesn't like being tinkered with . And funny thing is, /sys/kernel/config/ is empty... The board seems similar to others, we supposed they included drivers for MOSI/MISO pins. Can somebody point us on the right direction? It's a pitty that Xunlog doesn't invest in more research and development on software, we really enjoy their hardware but we're going for RPi probably. ...
martinayotte Posted February 16, 2019 Posted February 16, 2019 14 hours ago, spaceship said: /sys/ doesn't like being tinkered with . And funny thing is, /sys/kernel/config/ is empty... Which kind of image are you running ? Directory /sys/kernel/config/device-tree/overlays should be present in Armbian NEXT or DEV ...
spaceship Posted February 16, 2019 Author Posted February 16, 2019 We downloaded from here, the 4.18 (And it is the version we're using) :https://www.armbian.com/orange-pi-one-plus/ We tried the 4.20 before it was available on the previous link and the board didn't boot after reboot. Regarding the branch, probably it is set to default as we didn't specify anywhere next or dev. Is this an option at first installation?
Igor Posted February 16, 2019 Posted February 16, 2019 15 hours ago, spaceship said: we're going for RPi probably That is going from some latest board (that is not supported by Armbian) back to 10+ years old matured technology (Rpi 1,2,3). Go one step back (H3 & H5 boards) and you will be fine. Cheap high-end/latest hardware and excellent support rarely never meet each other. 15 hours ago, spaceship said: It's a pitty that Xunlog doesn't invest in more research and development on software Xunlong is investing in their old stock 3.10.y kernel (if) which is tailored for their boards. Since this kernel is too old, there is virtually no community interest for involvement. Mainline, which you are trying to use and want to have, is community made. There is some involvement from Xunlong and they also support our project, but theirs and others donations together does not come close to perhaps cover one full time person, while we would need a few to deal with "you" at this stage of the project. Not to do any serious R&D. The rest, random end user donations, cover less than one day of support - guidance and explanation which you are getting now. Per year. Just to get a picture. But nevertheless we, and people on other related projects, still do develop, fix something and help you. Because we like doing this. The problem is that more and more things, that nobody wants do just for fun, are piling up.
martinayotte Posted February 16, 2019 Posted February 16, 2019 1 hour ago, spaceship said: We downloaded from here, the 4.18 (And it is the version we're using) :https://www.armbian.com/orange-pi-one-plus/ Those images are quite old ... The device tree overlays for H6 has been committed far later ! Maybe you should build your own image ...
spaceship Posted February 16, 2019 Author Posted February 16, 2019 Igor, i commend you for all the work done here. With the growth of ARM architecture, Armbian will set both feet under the spotlight in the years to come, i foresee great adoption of this distro . I cannot thank you enough for what you and your team have done so far (And at least will donate. Regarding this issue, would be nice to make it more visible, the option to donate) . I blame the hardware producers, not the ones doing pro bono work. @martinayotte where are de latest images available? I would guess the download section would point us in the right direction. Edit: Will just lay here the links with respect to information regarding custom builds (if someone stumbles upon this thread):https://docs.armbian.com/Developer-Guide_Build-Preparation/https://github.com/armbian/build We'll dig into this. Thank you all. 1
martinayotte Posted February 16, 2019 Posted February 16, 2019 3 hours ago, spaceship said: @martinayotte where are de latest images available? There is no latest images, since OPiOne+ is still WIP, you absolutely need to build it yourself ...
spaceship Posted February 17, 2019 Author Posted February 17, 2019 22 hours ago, martinayotte said: There is no latest images, since OPiOne+ is still WIP, you absolutely need to build it yourself ... We built it. The following are the steps we took: > sudo armbian-add-overlay sun50i-h6-spi-spidev.dts (0) > reboot (1) > mkdir /sys/kernel/config/device-tree/overlays/spi (2) > cat /boot/overlay-user/sun50i-h6-spi-spidev.dtbo > /sys/kernel/config/device-tree/overlays/spi/dtbo (3) (.dts fie from step (0) is this one . In attachment (Bottom on post) we include both dts files we used, one was disassembled and corresponds to /boot/dtb-4.20.8-sunxi64/allwinner/overlay/sun50i-h6-spi-spidev.dtbo that came with the kernel build ) Now we have three folders inside the dtbo folder: dtbo, path and status; >cat status >unapplied We tried to cat (step (3) above) both files from: /boot/overlay-user/sun50i-h6-spi-spidev.dtbo /boot/dtb-4.20.8-sunxi64/allwinner/overlay/sun50i-h6-spi-spidev.dtbo Repeat step (1) At this point, still nothing shows. The resulting armbianEnv.txt: cat /boot/armbianEnv.txt verbosity=1 console=both overlay_prefix=sun50i-h6 rootdev=UUID=82f29a48-bbc5-4f83-8df9-b4819074fecd rootfstype=ext4 user_overlays=sun50i-h6-spi-spidev param_spidev_spi_bus=0 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u lsmod produces the following: Module Size Used by zstd 16384 4 cpufreq_dt 16384 0 sun50i_h6_ths 16384 0 thermal_sys 65536 2 cpufreq_dt,sun50i_h6_ths zram 24576 5 realtek 20480 1 armbian-config shows the following : At the moment, ls /dev/spi shows nothing. (Will update with more info in the following minutes) dts from github dts disassembled that came with kernel
martinayotte Posted February 17, 2019 Posted February 17, 2019 2 hours ago, spaceship said: >cat status >unapplied This means the overlay been rejected, probably because of unavailable resource or bad node definition. "dmesg" may provide hints about this rejection ...
spaceship Posted February 17, 2019 Author Posted February 17, 2019 dmesg | grep spi Doesn't output anything.
martinayotte Posted February 17, 2019 Posted February 17, 2019 3 minutes ago, spaceship said: dmesg | grep spi Doesn't output anything Don't grep with "spi", since overlay is rejected, none of the spi code will be executed. So, look at the whole "dmesg" line by line. I'm pretty sure you will see some errors looking like "pinctrl : invalid pin handle" or "pinctrl : pin already used by ..."
spaceship Posted February 18, 2019 Author Posted February 18, 2019 19 hours ago, martinayotte said: Don't grep with "spi", since overlay is rejected, none of the spi code will be executed. So, look at the whole "dmesg" line by line. I'm pretty sure you will see some errors looking like "pinctrl : invalid pin handle" or "pinctrl : pin already used by ..." The only error that seems to be directly related to the overlays is this: > OF: resolver: overlay phandle fixup failed: -22 We'll look deeper into the device trees as the SPI configuration is definitly missing in the main dt file.
martinayotte Posted February 18, 2019 Posted February 18, 2019 56 minutes ago, spaceship said: The only error that seems to be directly related to the overlays is this: > OF: resolver: overlay phandle fixup failed: -22 We'll look deeper into the device trees as the SPI configuration is definitly missing in the main dt file. You are right ! Although the overlay have been committed, it never been tested, and Yes, there are stuff missing in Main DT to make it work ... EDIT : Looking at this task, it looks more difficult to achieve, the H6 SPI are not at the same pins than H5, I will try to figure out ... EDIT2 : Also, not the same IRQ and DMA ... Hope it will work ...
spaceship Posted February 18, 2019 Author Posted February 18, 2019 Thank you very much @martinayotte . Our hopes are with you, as this seems out of our reach for now.
martinayotte Posted February 18, 2019 Posted February 18, 2019 2 hours ago, spaceship said: Thank you very much @martinayotte . Our hopes are with you, as this seems out of our reach for now. I got the things working ! Although I didn't tested it with real SPI device, I've at least tested it with loopback wire between MISO/MOSI and executed spidev_test ... https://github.com/armbian/build/commit/34205e60b3efa0ef3acc293ed9e02b801f8a52c1 2
spaceship Posted February 18, 2019 Author Posted February 18, 2019 Thank you very much @martinayotte ! It works like a charm! We're able to communicate with an external device. We will try and see what's going on in the sun4i-i2s driver. Again great job martinayotte, thank you! Edit: Donated a little bit of money, it would be nice that others looking for help would do the same. 1
Recommended Posts