we use mx6q sabresd board and run linux 3.0.35, now I want to use uart4,but I can't find ttymxc3 in /dev/
I read porting guide for this, I add follow code in board.c, after add this code, I can find ttymxc3 in /dev, but this uart can't send or receive data.
// yuanmm add uart begin | |
imx6q_add_imx_uart(1, NULL); | |
imx6q_add_imx_uart(3, NULL); | |
imx6q_add_imx_uart(4, NULL); | |
// yuanmm add uart end |
test step:
cat /dev/ttymxc3 &
echo ymm > /dev/ttymxc3
已解决! 转到解答。
Hi mingmingyuan,
Your step is OK. Sorry for late reply. I wonder if your uart4 can work now?
Have a nice day
Dan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi
It may possible that UART4 is not used so it might be disabled, so it better to verify.
It should be like
#define UART4_UCR4_CTSTL 16
#define UART4_DMA_ENABLE 1
#define UART4_DMA_RXBUFSIZE 512
#define UART4_UFCR_RXTL 16
#define UART4_UFCR_TXTL 16
Thanks
Saurabh
I have modified code, but uart4 can't work still.
/* UART 4 configuration */
#define UART4_UCR4_CTSTL 16// yuanmm change to 16 before is -1
#define UART4_DMA_ENABLE 1// yuanmm change to 1 before is 0
#define UART4_DMA_RXBUFSIZE 512// this number I have tried 512 and 1024
#define UART4_UFCR_RXTL 16
#define UART4_UFCR_TXTL 16
Hi mingming yuan,
Here I have a document for Debug UART Customization on i.MX6x. There are steps about how to modify you can refer to .
In the attachment you can see the document. Hope this can help you.
Have a great day
Dan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi danwang:
thank you for your support.
I have read this ppt and modified code for test, but uart4 can't work still.
this is my step, can you help to double check?
I want to use uart4 for data transmit in kernel not for debug, So I think I only need to modify code in kernel, needn't modify uboot and MFT code.
ppt description for board-mx6q_arm2, but I use sabresd board, so I need to modify Board-mx6q_sabresd.c and releational file.
1,arch\arm\mach-mx6\serial.h
I check uart4 configration and only change UART4_UCR4_CTSTL from -1 to 16, other configration use default setting
/* UART 4 configuration */
#define UART4_UCR4_CTSTL 16// yuanmm change to 16 before is -1
#define UART4_DMA_ENABLE 0
#define UART4_DMA_RXBUFSIZE 512
#define UART4_UFCR_RXTL 16
#define UART4_UFCR_TXTL 16
2, arch\arm\mach-mx6\Board-mx6q_sabresd.h
add code as follow,as hareware design, We use pad csi0 data12 and data13,not PAD_KEY_COL0
// yuanmm add begin
MX6Q_PAD_CSI0_DAT12__UART4_TXD,
MX6Q_PAD_CSI0_DAT13__UART4_RXD,
// yuanmm add end
3, arch\arm\mach-mx6\Board-mx6q_sabresd.c
add code as follow:
static inline void mx6q_sabresd_init_uart(void)
{
imx6q_add_imx_uart(2, NULL);
imx6q_add_imx_uart(0, NULL);
// yuanmm add uart begin
imx6q_add_imx_uart(1, NULL);
imx6q_add_imx_uart(3, NULL);
imx6q_add_imx_uart(4, NULL);
// yuanmm add uart end
}
4,arch\arm\mach-mx6\Board-mx6q_sabresd.c
as ppt description, I should add code
early_console_setup(UART4_BASE_ADDR, uart_clk);
but I think this functiong is for console setting, so I didn't add this code for uart4
5, arch\arm\plat-mxc\include\mach\Uncompress.h
this fill already have follow code, so I didn't modify this code
case MACH_TYPE_MX6Q_SABRESD:
uart_base = MX6Q_UART1_BASE_ADDR;
break;
Hi mingmingyuan,
Your step is OK. Sorry for late reply. I wonder if your uart4 can work now?
Have a nice day
Dan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------