Additional UART in u-boot

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

Additional UART in u-boot

跳至解决方案
5,152 次查看
david_schmidt
Contributor II

Hi,

I need to use an additional UART interface (UART2) in my case during u-boot to send and recevice data to a peripheral. My u-boot console should still work with my current UART interface (UART1).

I have added my UART2 to my dtsi file:

&uart2 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_uart2>;
    status = "okay";
};

I suppose I need 3 functions, uart_init, uart_putc and uart_getc.

Can I use the routines from /drivers/serial/serial_mxc.c?

It allows only using one UART interface, defined by

#define UART_PHYS   CONFIG_MXC_UART_BASE

Thanks for the help.

0 项奖励
回复
1 解答
4,339 次查看
david_schmidt
Contributor II

To use an additional UART interface in u-boot, one can copy the functions from /drivers/serial/serial_mxc.c.

The thing I missed was the 

imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));

pin initialization in the board.c, but this only works in board_init or board_late_init, and not in board_early_init_f

After that, the send and receive functions work properly.

在原帖中查看解决方案

2 回复数
4,340 次查看
david_schmidt
Contributor II

To use an additional UART interface in u-boot, one can copy the functions from /drivers/serial/serial_mxc.c.

The thing I missed was the 

imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));

pin initialization in the board.c, but this only works in board_init or board_late_init, and not in board_early_init_f

After that, the send and receive functions work properly.

4,339 次查看
igorpadykov
NXP Employee
NXP Employee

Hi David

one can look at implementation of this feature on other boards and post

issue on uboot mail list

[U-Boot] [PATCH 02/18] Blackfin: uart: add multiple serial support 

lists.denx.de Mailing Lists 

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

0 项奖励
回复