Enable SPI in Debian

I believe I have it working by updating the device tree. Steps:

Decompile device tree

dtc -I dtb -O dts -o rockpi-4b-linux.dts /boot/dtbs/4.4.154-73-rockchip-00007-g155a65a/rockchip/rockpi-4b-linux.dtb

Update the device tree. I am using spi2, which is ff1e0000. To spi@ff1e0000, I added

spidev@0 {
compatible = “spidev”;
status = “okay”;
reg = <0x00000000>;
spi-max-frequency = <0x00989680>;
};

Recompile

dtc -I dts -O dtb -o /boot/dtbs/4.4.154-73-rockchip-00007-g155a65a/rockchip/rockpi-4b-linux.dtb rockpi-4b-linux.dts

and reboot. You should now have /dev/spidev32766.0 You can use spidev_test with a jumper from pins 29 & 31 to test.