nik-ii
Members
-
Joined
-
Last visited
Reputation Activity
-
nik-ii reacted to TonyMac32 in Use GPIO on C2 with Mainline Kernel@sgjava the mainline device tree doesn't have the spi nodes the 3.14 had: https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L802
That looks like generic GPIO SPI, and I haven't found, in the last 20 minutes or so, where the spicc and spifc pops out of the processor GPIO wise. It does not appear to be GPIOX, so I think on the C2 the setup has to be a software SPI. NanoPi K2 appears to be in the same position, just plain not having SPI. I will investigate adding it to K2, then someone with a C2 can try it.
-
nik-ii reacted to sgjava in Use GPIO on C2 with Mainline Kernel@nik-ii OK, I had some time to play around with my C2 which already had Armbian Stretch installed:
Linux hostname 4.18.8-odroidc2 #264 SMP PREEMPT Wed Sep 19 12:35:18 CEST 2018 aarch64 GNU/Linux
armbian-config has no Hardware menu, but it looks like GPIO and I2C are already enabled:
ls /dev/gpio* /dev/i2c* /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
/dev/gpiochip0 /dev/gpiochip1 /dev/i2c-0 /dev/i2c-1
If you go to the Odroid C2 wiki you can follow the steps to enable SPI:
sudo su -
modprobe spidev
modprobe spi_gpio
modprobe: FATAL: Module spi_gpio not found in directory /lib/modules/4.18.8-odroidc2
modprobe spi_bitbang
lsmod | grep spi
spi_bitbang 16384 0
spidev 20480 0
ls /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
I'm not sure what's going on here because this works with the HardKernel OS images. I'm actually using my C2 as a Jenkins CI server, but I did play around and made sure gpio, i2c and spi worked. I believe that was a 3.x kernel though @Igor may be able to point you in a better direction to get SPI cranking.
There are other drivers, but I'm not sure which one to use:
ls /lib/modules/4.18.8-odroidc2/kernel/drivers/spi
spi-bitbang.ko spi-butterfly.ko spidev.ko spi-lm70llp.ko spi-meson-spifc.ko
-
nik-ii reacted to sgjava in Use GPIO on C2 with Mainline Kernel@nik-ii I actually have a C2 and I think I just loaded mainline on it a few weeks ago. I'll check tonight, but if your SBC is using mainline then it should work. With armbian-config you need to enable SPI, I2C, etc. I'll reply back here later with C2 specific info.
Note from your pic that GPIO is showing up.