IMX6ULL device tree

I am trying to start with the IMX6ULL module by accessing basic peripherals and i am new to linux. High performance, low power Embedded Computing Systems | Toradex Developer Center this page says that by default the BSPs of the colibri imx6ull use CAN instead of SPI. So in order to access SPI we need to disable CAN and enable SPI in the device tree. As i said earlier, i am new with the board and Linux. So that i dont even know how to open device tree and modify it. Can anyone help me with this thing . And i expect a detailed description.Thanks

Dear @Hasanul_Banna

Welcome to the Toradex Community!

Yes that’s right. By default the mcp2515 CAN controller is enabled and the spidev0 is disabled. If you want to use the spidev driver to access SPI from user-space, you have to disable the node mcp2515 and enable the node spidev0 in the device-tree as described here (same procedure for iMX6ULL).

We have a very detailed article about Device Tree Customization which I recommend to work through. A device tree is a data structure which describes a system’s hardware and it’s loaded while booting. It defines things like connected I2C devices, GPIO pins, display parameters and much more. To change the device tree you have to change the device tree source files. One or multiple device tree source files (*.dts or *.dtsi) can be compiled to a device tree binary (*.dtb). The device tree binary can then be placed within the Toradex Easy Installer Image to be loaded to the target module.

This is a very abstract and short explanation of that complex topic. I would recommend to start with reading through the mentioned article and doing a small change for exercise. Also before starting with changing the device tree, you should go through this article, clone the Git repository with our Linux Kernel and build the Kernel once. You’ll also find the device tree source files in this repository.

These are the changes I made to make the spidev available on the Colibri iMX6ULL:

diff --git a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
index 192cd7326d6d..0e5b9ce0af6f 100644
--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -94,14 +94,14 @@
                spi-max-frequency = <10000000>;
                vdd-supply = <&reg_3v3>;
                xceiver-supply = <&reg_5v0>;
-               status = "okay";
+               status = "disabled";
        spidev0: spidev@0 {
                compatible = "toradex,evalspi";
                reg = <0>;
                spi-max-frequency = <23000000>;
-               status = "disabled";
+               status = "okay";

Best regards

Thanks @diego_b.tx
This was really helpful and very much detailed. It really worked for me.Hopes you’ll be there to help if i need clarification in any other issues.

@Hasanul_Banna you’re welcome!