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 i2c #182

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/arm/BONE-I2C1.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /bone/i2c/1
*
* Note: This can not be used along with BONE-I2C3-00A0 on BBB as
* both uses i2c1 internally and only one can be used at a time.
*
* 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-I2C1 = __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_18_pinmux { pinctrl-0 = <&P9_18_i2c_pin>; }; /* i2c sda */
P9_17_pinmux { pinctrl-0 = <&P9_17_i2c_pin>; }; /* i2c scl */
};

/*
* 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_i2c_1 {
status = "okay";
};
44 changes: 44 additions & 0 deletions src/arm/BONE-I2C2.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /bone/i2c/2
*
* Note: This can not be used along with BONE-I2C2A-00A0 on BBB as
* both uses i2c2 internally and only one can be used at a time.
*
* 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-I2C2 = __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_20_pinmux { pinctrl-0 = <&P9_20_i2c_pin>; }; /* i2c sda */
P9_19_pinmux { pinctrl-0 = <&P9_19_i2c_pin>; }; /* i2c scl */
};

/*
* 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_i2c_2 {
status = "okay";
};
44 changes: 44 additions & 0 deletions src/arm/BONE-I2C2A.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /bone/i2c/2a (only on BBB)
*
* Note: This can not be used along with BONE-I2C2-00A0 on BBB as
* both uses i2c2 internally and only one can be used at a time.
*
* 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-I2C2A = __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_22_pinmux { pinctrl-0 = <&P9_22_i2c_pin>; }; /* i2c sda */
P9_21_pinmux { pinctrl-0 = <&P9_21_i2c_pin>; }; /* i2c scl */
};

/*
* 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_i2c_2a {
status = "okay";
};
44 changes: 44 additions & 0 deletions src/arm/BONE-I2C3.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2020 Deepak Khatri <[email protected]>
*
* Virtual cape for /bone/i2c/3
*
* Note: This can not be used along with BONE-I2C1-00A0 on BBB as
* both uses i2c1 internally and only one can be used at a time.
*
* 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-I2C3 = __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_26_pinmux { pinctrl-0 = <&P9_26_i2c_pin>;}; /* i2c sda */
P9_24_pinmux { pinctrl-0 = <&P9_24_i2c_pin>;}; /* i2c scl */
};

/*
* 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_i2c_3 {
status = "okay";
};