I can’t get /dev/spidev* to appear, either with no-GUI Debian, nor my custom kernel.
Here is uname -a from the no-GUI Debian:
Linux BeagleBone 6.6.32-ti-arm64-r10 #1 SMP PREEMPT_DYNAMIC Mon Jul 15 21:33:03 UTC 2024 aarch64 GNU/Linux
After sudo modprobe spidev the /dev/spidev device nodes(s) should appear.
The spi0 SPI master device does exist:
debian@BeagleBone:~$ ls -ld /sys/class/spi_master/spi0/*
lrwxrwxrwx 1 root root 0 Aug 7 2024 /sys/class/spi_master/spi0/device -> ../../../20120000.spi
lrwxrwxrwx 1 root root 0 Feb 25 04:10 /sys/class/spi_master/spi0/of_node -> ../../../../../../firmware/devicetree/base/bus@f0000/spi@20120000
drwxr-xr-x 2 root root 0 Feb 25 04:10 /sys/class/spi_master/spi0/power
drwxr-xr-x 2 root root 0 Feb 25 04:10 /sys/class/spi_master/spi0/statistics
lrwxrwxrwx 1 root root 0 Aug 7 2024 /sys/class/spi_master/spi0/subsystem -> ../../../../../../class/spi_master
-rw-r--r-- 1 root root 4096 Aug 7 2024 /sys/class/spi_master/spi0/uevent
The spi0 base address 0x20120000 corresponds to MCSPI2 and the schematic shows that SPI2_CS0 is routed to the mikroBUS socket SCK pin.
I can run a program to toggle GPIO3_12 (RST) successfully. Running the same program to toggle GPIO3_13 (CS) runs successfully but the nothing shows on my oscilloscope.
The only anomaly I have been able to find in the source code is that in the device tree source file k3-am625-beagleplay.dts the SPI output pins are marked as inputs:
The channel@0 node is what makes the actual spidev…
Don’t get hung up on the GPIO Pin direction; it only applies to the GPIO part of the pin.
Once you switch the PINMUX, whatever underlying device is selected, it is now in direct control of any directional capabilities of said pin and will override it.
I eventually remembered having to deal with this exact same issue in my custom kernel for the Orange Pi Zero 2W. I enabled the creation of /dev/spidev0.0 by my custom kernel by patching two kernel source files: