Hi,大家:
小弟有些code設計的問題想請教大家一下,因為我在L3.10.53 BSP source code中imx6qdl-sabresd.dtsi()只有看到uart1的設計,如下:
&uart1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart1_1>;
status = "okay";
};
那我若是有新硬體uart2、uart4、uart5(各含有TX,RX,RTS,CTS 4個信號),那我應該怎麼設計code比較好呢?因為原始code寫法是針對debug prot(TX,RX)設計,故不知能直接拿來用嗎?
例如:
寫一個很像的
&uart2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart2_1>;
status = "okay";
};
這樣不知道可否?
然後在原始code mx6sabresd.c中如下:
iomux_v3_cfg_t const uart1_pads[] = {
MX6_PAD_CSI0_DAT10__UART1_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
MX6_PAD_CSI0_DAT11__UART1_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
};
我可以多寫一個如下的設定嗎:
iomux_v3_cfg_t const uart2_pads[] = {
MX6_PAD_CSI0_DAT14__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
MX6_PAD_CSI0_DAT15__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL),
MX6_PAD_CSI0_DAT18__UART2_RTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
MX6_PAD_CSI0_DAT19__UART2_CTS_B | MUX_PAD_CTRL(UART_PAD_CTRL),
};
然後這又該如何驅動呢?因為uart1靠如下驅動:
static void setup_iomux_uart(void)
{
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}
還是不能這樣寫,再麻煩大家幫忙一下了,感謝大家。
(初學修改code,不是很熟,請大家見諒~~~)
已解决! 转到解答。
Hi 陳 冠儒
for other uarts examples one can at sabreai dts files, imx6qdl-sabreauto.dtsi:
Linux/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi - Linux Cross Reference - Free Electrons
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi 陳 冠儒
for other uarts examples one can at sabreai dts files, imx6qdl-sabreauto.dtsi:
Linux/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi - Linux Cross Reference - Free Electrons
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
hi,igorpadykov:
thanks for your help.
But if I want to design uart2, uart3 has TX RX CTS RTS, how I want to do, by the reference point you provide do not see how to design, guidance about the trouble you.