Can't enable UART4 on imx8mm using Device Tree

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

Can't enable UART4 on imx8mm using Device Tree

Jump to solution
3,511 Views
Vitali_K
Contributor II

Hi,

I'm trying to connect a modem chip on the board, which design is based on imx8mm.
The modem is connected to pins X1_4 (UART4_TXD) and X2_67 (UART4_RXD)

I made the following changes in the device tree:

&uart4 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
assigned-clocks = <&clk IMX8MM_CLK_UART4>;
assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
/delete-property/ dmas;
/delete-property/ dma-names;
fsl,dte_mode;
status = "okay";
};

pinctrl_uart4: uart4grp {
fsl,pins = <
// reverted TX /RX in DTE mode
MX8MM_IOMUXC_UART4_RXD_UART4_DTE_TX 0x140
MX8MM_IOMUXC_UART4_TXD_UART4_DTE_RX 0x140
>;
};

Even if ttymxc3 created, the bit UARTEN of UART4_UCR1 shows that the UART4 is disabled. Why?

[ 1.037192] 30a60000.serial: ttymxc3 at MMIO 0x30a60000 (irq = 39, base_baud = 5000000) is a IMX

~# devmem2 0x30a60080
/dev/mem opened.
Memory mapped at address 0xffffb460a000.
Read at address 0x30A60080 (0xffffb460a080): 0x00000000

The bit DCEDTE in UARTx_UFCR also is not set - meaning that DTE is not configured:

# devmem2 0x30a60090
/dev/mem opened.
Memory mapped at address 0xffff90e96000.
Read at address 0x30A60090 (0xffff90e96090): 0x00000801

How do I enable UART4 correctly?

Best regards,
Vitali

Tags (3)
0 Kudos
Reply
1 Solution
3,452 Views
Vitali_K
Contributor II

BiyongSUN, thank you for the reply.

You're absolutely right - I checked the UARTEN bit on the wrong point of time. After using the UART it is set: "Read at address 0x30A60080 (0xffffb460a080): 0x00000201"

I've found the error related to DTE mode too: it must be "fsl,dte-mode", not "fsl,dte_mode" (shame on me!)

Vitali

View solution in original post

0 Kudos
Reply
4 Replies
3,453 Views
Vitali_K
Contributor II

BiyongSUN, thank you for the reply.

You're absolutely right - I checked the UARTEN bit on the wrong point of time. After using the UART it is set: "Read at address 0x30A60080 (0xffffb460a080): 0x00000201"

I've found the error related to DTE mode too: it must be "fsl,dte-mode", not "fsl,dte_mode" (shame on me!)

Vitali

0 Kudos
Reply
3,462 Views
BiyongSUN
NXP Employee
NXP Employee

because you haven't used the uart4. 

here is the test, use the uart4 as second login/debug console.

Untitled1.png

0 Kudos
Reply
3,501 Views
igorpadykov
NXP Employee
NXP Employee

Hi Vitali

 

for uart4 one can look at below example

https://github.com/boundarydevices/linux-imx6/blob/boundary-imx_5.4.x_2.3.0/arch/arm64/boot/dts/free...

In nxp releases uart4 can be used by M4 SDK   https://mcuxpresso.nxp.com/en/welcome

 

Best regards
igor

0 Kudos
Reply
3,484 Views
Vitali_K
Contributor II

Hi Igor,

Thank you for good example about UART.
I think I made the same changes as in the example, but it does not work and I don't understand why.

Vitali

0 Kudos
Reply