Hi! I am using a custom kernel (I need OP-TEE and RT patches on a Raspberry Pi 3 model B). Kernel version is 4.6.3 I am trying to use the Navio2 board and have managed to get most of the drivers working. However, the rcio driver fails to load correctly and does not generate any node in /sys/kernel/.
This is what I have:
I don’t have overlay support, since I am using u-boot and have failed to figure out how to enable the feature in it. I, thus, resort to manually applying the relevant overlays to the base dts file and compiling it to create the dtb file which is loaded.
I did manage to boot Linux with Device Tree support using u-boot in the past. I suggest looking into u-boot master or Yocto’s u-boot. AFAIK, the dtb address may be passed through a register and then read by u-boot to load dtb and kernel from the appropriate address (rather than hardcoded in /boot/config.txt). I suggest try to boot a kernel with DTB with U-Boot and then just load our rcio.dtbo. This is not so hard to do! This has been done by Mender.io guys using raspberrypi-meta (which might include the needed U-Boot version by now. At the time I was poking around I needed to apply a couple of patches myself) a while back. You have done a pretty awesome job by putting all of the pieces together up until now. So I guess with these tips you’ll get the results you’re craving in no time.
sudo vcdbg log msg output is also useful while debugging these low-level details.
If that doesn’t work out for you we may think of other solution. Keep up the good work, then.
Turns out it was a problem in how the rcio driver checks SPI and PWM interfaces. The error code -16 was being thrown because of multiple checks and was completely unrelated to SPI. In case anyone has a similar problem, check whether you have a pwmchip0 already created under /sys/class/pwm. Essentially, the driver expects that pwmchip0 will not exist and fails while initializing it (since it already exists). This causes the RCIO SPI interface initialization to fail. Simply disable pwm in your device tree (I’ll try creating a patch to generate a error/warning to tell the user to do this). This will prevent the pwmchip0 interface to be created automatically, allow the driver to generate it and rcio will appear under /sys/kernel.