questions about uart node in different imx8mp device trees

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

questions about uart node in different imx8mp device trees

跳至解决方案
188 次查看
machangbao
Contributor III


In https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
&uart1 { /* BT */
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
assigned-clocks = <&clk IMX8MP_CLK_UART1>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
uart-has-rtscts;
status = "okay";

bluetooth {
compatible = "nxp,88w8997-bt";
};
};

&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3>;
assigned-clocks = <&clk IMX8MP_CLK_UART3>;
assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
uart-has-rtscts;
status = "okay";
};

In https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/arch/arm64/boot/dts/freescale/imx8mp-venice-gw74...

/* GPS / off-board header */
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1>;
status = "okay";
};

/* bluetooth HCI */
&uart3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart3>, <&pinctrl_uart3_gpio>;
cts-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
rts-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
status = "okay";

bluetooth {
compatible = "brcm,bcm4330-bt";
shutdown-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
};
};

 

Two questions:

1. are propertys assigned-clocks assigned-clock-parents  necessary?  What would happen if it's lacking?

2. What are the differences between the two hardware flow control methods uart-has-rtscts and uart-has-rtscts &cts-gpios&rts-gpios?  

标签 (1)
0 项奖励
回复
1 解答
124 次查看
Rita_Wang
NXP TechSupport
NXP TechSupport

Q1:

1. are propertys assigned-clocks assigned-clock-parents  necessary?  What would happen if it's lacking?

A:Yes, necessary. These properties are part of the Common Clock Framework in Linux device trees. They are used to configure the clock source and parent for a peripheral at boot time.

If lacking, Incorrect baud rate if the default clock frequency doesn’t match what the driver expects.Potential instability if the clock source is not optimal for low-power or performance modes.

2. What are the differences between the two hardware flow control methods uart-has-rtscts and uart-has-rtscts &cts-gpios&rts-gpios?  

A:uart-has-rtscts 是一个 Device Tree 属性,用于告诉 Linux UART 驱动该串口支持 硬件流控 (RTS/CTS),并且应该启用它。RTS (Request To Send) 和 CTS (Clear To Send) 信号由 UART 控制器硬件自动处理,不需要软件干预

The driver will enable hardware flow control( (RTS/CTS)) function when initializing UART.

cts-gpios 和 rts-gpios 是 Device Tree 属性,用于在硬件没有原生 RTS/CTS 引脚,或者需要通过 GPIO 来模拟流控时使用。驱动会通过 GPIO 来实现流控,而不是使用 UART 控制器的硬件 RTS/CTS.

Rita_Wang_0-1763017665901.png

 

 

 

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
125 次查看
Rita_Wang
NXP TechSupport
NXP TechSupport

Q1:

1. are propertys assigned-clocks assigned-clock-parents  necessary?  What would happen if it's lacking?

A:Yes, necessary. These properties are part of the Common Clock Framework in Linux device trees. They are used to configure the clock source and parent for a peripheral at boot time.

If lacking, Incorrect baud rate if the default clock frequency doesn’t match what the driver expects.Potential instability if the clock source is not optimal for low-power or performance modes.

2. What are the differences between the two hardware flow control methods uart-has-rtscts and uart-has-rtscts &cts-gpios&rts-gpios?  

A:uart-has-rtscts 是一个 Device Tree 属性,用于告诉 Linux UART 驱动该串口支持 硬件流控 (RTS/CTS),并且应该启用它。RTS (Request To Send) 和 CTS (Clear To Send) 信号由 UART 控制器硬件自动处理,不需要软件干预

The driver will enable hardware flow control( (RTS/CTS)) function when initializing UART.

cts-gpios 和 rts-gpios 是 Device Tree 属性,用于在硬件没有原生 RTS/CTS 引脚,或者需要通过 GPIO 来模拟流控时使用。驱动会通过 GPIO 来实现流控,而不是使用 UART 控制器的硬件 RTS/CTS.

Rita_Wang_0-1763017665901.png

 

 

 

 

0 项奖励
回复
85 次查看
kawateb265
Contributor II

@Rita_Wang 

 

There's a very serious mistake in your answer.

https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/Documentation/devicetree/bindings/serial/serial....

if:
  required:
    - uart-has-rtscts
then:
  properties:
    cts-gpios: false
    rts-gpios: false

 

 

 

Rita_Wang_0-1763017665901.png

 

 

https://github.com/nxp-imx/linux-imx/blob/lf-6.12.y/Documentation/devicetree/bindings/serial/serial....

 

 

cts-gpios:
maxItems: 1
description:
Must contain a GPIO specifier, referring to the GPIO pin to be used as
the UART's CTS line.

 

 rts-gpios:
    maxItems: 1
    description:
      Must contain a GPIO specifier, referring to the GPIO pin to be used as
      the UART's RTS line.

 

 uart-has-rtscts:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      The presence of this property indicates that the UART has dedicated lines
      for RTS/CTS hardware flow control, and that they are available for use
      (wired and enabled by pinmux configuration).  This depends on both the
      UART hardware and the board wiring.

 

if:
  required:
    - uart-has-rtscts
then:
  properties:
    cts-gpios: false
    rts-gpios: false

 

 

0 项奖励
回复