Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bone spi #183

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
51 changes: 51 additions & 0 deletions src/arm/BONE-SPI0_0.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /dev/bone/spi/0.0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/dts-v1/;
/plugin/;

/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
BONE-SPI0_0 = __TIMESTAMP__;
};
};

/*
* Update the default pinmux of the pins.
* See these files for the phandles (&P9_* & &P8_*)
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am335x-bone-common-univ.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am572x-bone-common-univ.dtsi
*/
&ocp {
P9_17_pinmux { pinctrl-0 = <&P9_17_spi_cs_pin>; }; /* CS*/
P9_18_pinmux { pinctrl-0 = <&P9_18_spi_pin>; }; /* MOSI */
P9_21_pinmux { pinctrl-0 = <&P9_21_spi_pin>; }; /* MISO */
P9_22_pinmux { pinctrl-0 = <&P9_22_spi_sclk_pin>; }; /* CLK */
};

/*
* See these files for the phandles (&bone_*) and other bone bus nodes
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbai-bone-buses.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbb-bone-buses.dtsi
*/
&bone_spi_0 {
status = "okay";

channel@0 {
reg = <0>;
compatible = "spidev";
symlink = "bone/spi/0.0";
spi-max-frequency = <16000000>;
spi-cpha;
};
};
51 changes: 51 additions & 0 deletions src/arm/BONE-SPI1_0.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /dev/bone/spi/1.0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/dts-v1/;
/plugin/;

/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
BONE-SPI1_0 = __TIMESTAMP__;
};
};

/*
* Update the default pinmux of the pins.
* See these files for the phandles (&P9_* & &P8_*)
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am335x-bone-common-univ.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am572x-bone-common-univ.dtsi
*/
&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 */
};

/*
* See these files for the phandles (&bone_*) and other bone bus nodes
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbai-bone-buses.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbb-bone-buses.dtsi
*/
&bone_spi_1 {
status = "okay";

channel@0 {
reg = <0>;
compatible = "spidev";
symlink = "bone/spi/1.0";
spi-max-frequency = <16000000>;
spi-cpha;
};
};
51 changes: 51 additions & 0 deletions src/arm/BONE-SPI1_1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /dev/bone/spi/1.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/dts-v1/;
/plugin/;

/*
* Helper to show loaded overlays under: /proc/device-tree/chosen/overlays/
*/
&{/chosen} {
overlays {
BONE-SPI1_1 = __TIMESTAMP__;
};
};

/*
* Update the default pinmux of the pins.
* See these files for the phandles (&P9_* & &P8_*)
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am335x-bone-common-univ.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/am572x-bone-common-univ.dtsi
*/
&ocp {
P9_42_pinmux { pinctrl-0 = <&P9_42_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 */
};

/*
* See these files for the phandles (&bone_*) and other bone bus nodes
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbai-bone-buses.dtsi
* https://github.com/lorforlinux/BeagleBoard-DeviceTrees/blob/compatibility/src/arm/bbb-bone-buses.dtsi
*/
&bone_spi_1 {
status = "okay";

channel@1 {
reg = <1>;
compatible = "spidev";
symlink = "bone/spi/1.1";
spi-max-frequency = <16000000>;
spi-cpha;
};
};