how to add new device in dts for uart

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to add new device in dts for uart

3,801 Views
srinivasaporam
Contributor II

Hi,

We have IMX6 board, for which we are connecting some sensor at UART. If we are connecting to i2c /SPI. then we are are defining them in device tree like this:

i2c3: i2c@021a8000 {

                #address-cells = <1>;

                #size-cells = <0>;

                compatible = "fsl,imx6q-i2c", "fsl,imx21-i2c";

                reg = <0x021a8000 0x4000>;

                interrupts = <0 38 IRQ_TYPE_LEVEL_HIGH>;

                clocks = <&clks IMX6QDL_CLK_I2C3>;

                status = "okay";

               devicename@0xab {

                    compatible = "meas-spec,ms5803";

                    reg = <0xab>;

                           

                };

  };

for SPI:

ecspi1: ecspi@02008000 {

                    #address-cells = <1>;

                    #size-cells = <0>;

                    compatible = "fsl,imx6q-ecspi", "fsl,imx51-ecspi";

                    reg = <0x02008000 0x4000>;

                    interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;

                    clocks = <&clks IMX6QDL_CLK_ECSPI1>,

                         <&clks IMX6QDL_CLK_ECSPI1>;

                    clock-names = "ipg", "per";

                    dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;

                    dma-names = "rx", "tx";

                    cs-gpios = <&gpio2 30 0>;

                    fsl,spi-num-chipselects = <1>;

                    status = "okay";

                    devicename@x {

                       compatible = "spidev";

                       reg = <x>;

                      

                       spi-max-frequency = <20000000>;

                          };

like wise how to define for UART. is it necessary???

Labels (3)
0 Kudos
3 Replies

1,557 Views
srinivasaporam
Contributor II

Hi,

in the example you have given

linux-2.6-imx.git - Freescale i.MX Linux Tree

&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3_1>;
pinctrl-assert-gpios = <&max7310_b 4 GPIO_ACTIVE_HIGH>, /* CTS */
<&max7310_c 3 GPIO_ACTIVE_HIGH>; /* RXD and TXD */
fsl,uart-has-rtscts;
status = "okay";
/* for DTE mode, add below change */
/* fsl,dte-mode; */
/* pinctrl-0 = <&pinctrl_uart3dte_1>; */
};

uart3 is connected through max7310 which is connected to gpio.

But in our case, we are directly connecting a device/sensor to uart. then in that case how use it in device tree.

0 Kudos

1,557 Views
igorpadykov
NXP Employee
NXP Employee

below uart3 is not connected through max7310 which is connected to gpio

linux-imx6/imx6qdl-nitrogen6x.dtsi at boundary-imx_3.14.28_1.0.0_ga · boundarydevices/linux-imx6 · G...

0 Kudos

1,557 Views
igorpadykov
NXP Employee
NXP Employee

Hi Srinivasa

for uart example one can look at sabre ai board BT_WIFI_UART3

linux-2.6-imx.git - Freescale i.MX Linux Tree

linux-2.6-imx.git - Freescale i.MX Linux Tree

http://boundarydevices.com/mx6-device-tree-customization/

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos