How to create /dev/spidev2.0 for beaglebone AI?

How to create /dev/spidev2.0 for beaglebone AI?

How to create /dev/spidev2.0 for beaglebone AI?

This is in-work as a Google Summer of Code project.

Deepak’s overlay is here: https://github.com/lorforlinux/bb.org-overlays/blob/bone_spi/src/arm/BONE-SPI1_0-00A0.dts

The critical section is:

&ocp {
P9_28_pinmux { pinctrl-0 = <&P9_28_spi_cs_pin>; }; /* CS /
P9_30_pinmux { pinctrl-0 = <&P9_30_spi_pin>; }; /
MOSI /
P9_29_pinmux { pinctrl-0 = <&P9_29_spi_pin>; }; /
MISO /
P9_31_pinmux { pinctrl-0 = <&P9_31_spi_sclk_pin>; }; /
CLK */
};

&bone_spi_1_0 {
status = “okay”;
spi-max-frequency = <16000000>;
spi-cpha;
};

It depends on his changes to the base board device tree or it’ll fail to boot: https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbai-bone-buses.dtsi

The critical section is:

&mcspi3 {
#address-cells = <1>;
#size-cells = <0>;

bone_spi_1_0: channel@0 {
#address-cells = <1>;
#size-cells = <0>;
compatible = “spidev”;
symlink = “bone/spi/1.0”;
reg = <0>;
};

bone_spi_1_1: channel@1 {
#address-cells = <1>;
#size-cells = <0>;
compatible = “spidev”;
symlink = “bone/spi/1.1”;
reg = <1>;
};
};

That is, if I understand which port your are trying to expose. Some background and pins are show at https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec#SPI.

This doesn’t have all the background and instructions I’d like, but I believe Deepak will be updating it.

Best to have a serial cable and know how to deal with a hung-up boot, but might be a good place to start to use spidev on BeagleBone AI.

Otherwise, this is scheduled for the August tri-annual software image release, which isn’t that far away now.