Search by Tags

Device Tree Customization Examples

 
Applicable for

Article updated at 07 Jan 2020
Subscribe for this article updates

Introduction

This article is a collection of examples of Device Tree customization. Examples may get obsolete over time, please check the testing environment details.

General Purpose Input / Output (GPIO)

SION Bit - i.MX family

Tested on Embedded Linux BSP 2.8 / Colibri iMX7 / Colibri Evaluation Board

Remarks: you must check if the SION Bit is available for both the i.MX family you target (i.MX 6, i.MX7, etc,) as well as the specific pin you want to use (SoC pin exposed in the edge connector).

arch/arm/boot/dts/imx7-colibri.dtsi
diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index 4a1ef3f83faf..d2449ec2cb22 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -365,7 +365,7 @@
 
        pinctrl_gpio1: gpio1-grp {
                fsl,pins = <
-                       MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16       0x14 /* SODIMM 77 */
+                       MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16       ((1 << 30) | 0x14) /* SODIMM 77 */
                        MX7D_PAD_EPDC_DATA09__GPIO2_IO9         0x14 /* SODIMM 89 */
                        MX7D_PAD_EPDC_DATA08__GPIO2_IO8         0x74 /* SODIMM 91 */
                        MX7D_PAD_LCD_RESET__GPIO3_IO4           0x14 /* SODIMM 93 */

Inertial Measurement Unit (IMU)

InvenSense MPU-6050

Tested on Embedded Linux BSP 2.8 / Colibri iMX6ULL / Iris Carrier Board

Remarks: address 68 cannot be used since it is also used by the Iris RTC. The pin AD0 of MPU-6050 has to be driven high.

arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
index 5870638c3a6f..c2eb33edae6b 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -166,6 +166,12 @@
 		compatible = "st,m41t0";
 		reg = <0x68>;
 	};
+
+	mpu6050@69 {
+		compatible = "invensense,mpu6050";
+		reg = <0x69>;
+		status = "okay";
+	};
 };
 
 &lcdif {