DTS File to disable LCD and use it's GPIO in iMX6ULL

二次信任 提交于 2019-12-11 08:47:48

问题


I am using the Toradex system-on-module colibri imx6ULL with a custom board. I am trying to disable the LCD and use it's GPIOs for my sensors. I have followed the answer in this link. I got stuck with one of the suggestion in the answer.

In addition to assigning these pings to an iomuxc pinctrl group, you'll also need to assign the pinctrl group to an enabled node for them to get initialized. You can create a new node specifically for this purpose if you'd like.

  1. What does that line mean? Do I need to create a dummy node with status property set to okay?

  2. Can I change of the name appearing in /dev/ for uart port?

  3. How can I enable JTAG in my custom board?

My device tree source file is below:

/dts-v1/;

#include "imx6ull-colibri-nonwifi.dtsi"
#include "imx6ull-colibri-eval-v3.dtsi"

/ {
    model = "Toradex Colibri iMX6ULL 256MB on Colibri Evaluation Board V3";
    compatible = "toradex,colibri_imx6ull-eval", "fsl,imx6ull";

    &uart1 {
        status = "okay";
    };

    &uart2 {
        status = "okay";
    };

    &uart3 {
        status = "okay";
    };

    &uart4 {
        status = "disabled";
    };

    &uart5 {
        status = "disabled";
    };


    &ecspi1 {
        status = "okay";
    };

    &i2c1 {
        status = "okay";

        /* M41T0M6 real time clock on carrier board */
        rtc: m41t0m6@68 {
            status = "disabled";
        };
    };



    &pwm1 {
        status = "okay";
    };

    &pwm2 {
        status = "okay";
    };



    &lcdif {
        status = "disabled";
    };

    &iomux {
        imx6ull-colibri {
            pinctrl_additionalgpio: additionalgpios {
                fsl,pins = <
                    MX6UL_PAD_UART2_RTS_B__GPIO1_IO23 0x14      // Pin 34 => GPS SafeBoot
                    MX6UL_PAD_CSI_DATA00__GPIO4_IO21  0x14      // Pin 101 => 1V8 Power Supply Enable
                    MX6UL_PAD_LCD_ENABLE__GPIO3_IO01  0x14      // Pin 44 => GPS EXINT
                    MX6UL_PAD_LCD_DATA07__GPIO3_IO12  0x14      // Pin 46 => GPS RST
                    MX6UL_PAD_LCD_DATA09__GPIO3_IO14  0x14      // Pin 48 => UNUSED
                    MX6UL_PAD_LCD_DATA06__GPIO3_IO11  0x14      // Pin 80 => SX1301 RST
                >;
            };
        };
    };
};

The device tree imx6ull-colibri-nonwifi.dtsi can be found over here.

The device tree imx6ull-colibri-eval-v3.dtsi can be found over here.

EDIT:

I have tried few times on my own after reading some documents online on dts. Find the latest version of my dts below. I have also found out SPI is not working in my board so that I have edited my dts to include spi.

I have added a dummy node to enable gpio.

/dts-v1/;

#include "imx6ull-colibri-nonwifi.dtsi"
#include "imx6ull-colibri-eval-v3.dtsi"

/ {
    model = "Toradex Colibri iMX6ULL 256MB on Colibri Evaluation Board V3";
    compatible = "toradex,colibri_imx6ull-eval", "fsl,imx6ull";

    &uart1 {
        status = "okay";
    };

    &uart2 {
        status = "okay";
    };

    &uart3 {
        status = "okay";
    };

    &uart4 {
        status = "disabled";
    };

    &uart5 {
        status = "disabled";
    };


    &ecspi1 {
        status = "okay";
    };

    &i2c1 {
        status = "okay";

        /* M41T0M6 real time clock on carrier board */
        rtc: m41t0m6@68 {
            status = "disabled";
        };
    };



    &pwm1 {
        status = "okay";
    };

    &pwm2 {
        status = "okay";
    };



    &lcdif {
        status = "disabled";
    };

    gpio_additional {
        pinctrl-name = "default";
        pinctrl-0 = <&pinctrl_additionalgpio>;
        status = "okay";
    };

    &ecspi1 {
        status = "okay";

    };

    &iomux {
        imx6ull-colibri {
            pinctrl_additionalgpio: additionalgpios {
                fsl,pins = <
                    MX6UL_PAD_UART2_RTS_B__GPIO1_IO23 0x14      // Pin 34 => GPS SafeBoot
                    MX6UL_PAD_CSI_DATA00__GPIO4_IO21  0x14      // Pin 101 => 1V8 Power Supply Enable
                    MX6UL_PAD_LCD_ENABLE__GPIO3_IO01  0x14      // Pin 44 => GPS EXINT
                    MX6UL_PAD_LCD_DATA07__GPIO3_IO12  0x14      // Pin 46 => GPS RST
                    MX6UL_PAD_LCD_DATA09__GPIO3_IO14  0x14      // Pin 48 => UNUSED
                    MX6UL_PAD_LCD_DATA06__GPIO3_IO11  0x14      // Pin 80 => SX1301 RST
                >;
            };
        };
    };
};

回答1:


1) It means you need to add the pinctrl-group e.g. the one you have created pinctrl_additionalgpio to a node.

I'll take for instance the lcdif node you have disabled in you device-tree to illustrate a pinctrl-group added to a node. In this example, pinctrl_lcdif_dat and pinctrl_lcdif_ctrl are added to the lcdif node:

&lcdif {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_lcdif_dat
             &pinctrl_lcdif_ctrl>;
};

You have to either create a node of your own and add the pinctrl-group or find a suitable node, e.g.:

myadditionalgpio {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_additionalgpio>;
};

2) I have not ever got as far as changing the name of the device. If all you need is to have an alternative name, you can use a udev rule to create a symlink:

/etc/udev/rules.d/rename-uart.rules
KERNEL=="ttymxc0", SYMLINK+="test_serial"

Then you will have a /dev/test_serial device that points to /dev/ttymxc0.

3) You can have a look at the generic JTAG Toradex documentation https://developer.toradex.com/knowledge-base/jtag.



来源:https://stackoverflow.com/questions/51799533/dts-file-to-disable-lcd-and-use-its-gpio-in-imx6ull

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!